Skip to main content

Streamlit component that allows you to visualize and modify NER annotations

Project description

NER Entity Annotator

A Streamlit component for visualizing and modifying Named Entity Recognition (NER) annotations in the spaCy displacy entity recognizer style. This works well for NER classes that are not overlapping.

Key Features:

  • Visualization: Displays NER annotations in a clear and intuitive style.
  • Interactivity: Allows you to modify NER annotations directly in the interface.

The implementation leverages code partially ported from Python to React, inspired by the spaCy repository. For more details about the spaCy entity recognizer component, visit this page.

Installation instructions

pip install ner_entity_annotator

Usage instructions

import streamlit as st

from ner_entity_annotator import ner_entity_annotator

text = "Welcome to the Bank of China."
spans = [
    {"start_token": 15, "end_token": 28, "label": "ORG"},
]

result = ner_entity_annotator(
    text=text,
    spans=spans,
    labels=["ORG", "GPE"],
    options={
        "disable_span_position_edit": True
    }
)

Development

To set up and run the development environment, follow these steps:

Navigate to the ner_entity_annotator/frontend directory and run:

npm install    # Initialize the project and install npm dependencies
npm run start  # Start the Webpack dev server

Then go to the project root and run the example app:

pip install -e . # install template as editable package
streamlit run ner_entity_annotator/example.py # run the example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ner_entity_annotator-0.0.3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ner_entity_annotator-0.0.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file ner_entity_annotator-0.0.3.tar.gz.

File metadata

  • Download URL: ner_entity_annotator-0.0.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ner_entity_annotator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 72a065bfbebb228978b9cd7e166f6697b269bba0e2e0d9bed433539c55672cc2
MD5 d5b93ccae293f2789df712c59594fafb
BLAKE2b-256 62720d3e9a5fb771e5dec33dcec9555b4364004aaedeb73bb0585901961ebe8d

See more details on using hashes here.

File details

Details for the file ner_entity_annotator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ner_entity_annotator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 79e97d651ce54da8ead4edea0d99c2af1cd9aff8e535f1d3dd23069ab88f3b41
MD5 23608100b7337f92f892de684772d81f
BLAKE2b-256 6785c45f15258d20bb2d7d470694ba136214a94b6dc920235ba507b9eca94cf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page