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.5.tar.gz (841.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.5-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ner_entity_annotator-0.0.5.tar.gz
  • Upload date:
  • Size: 841.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.5.tar.gz
Algorithm Hash digest
SHA256 af3039084054278708ab1c8471be3d0afbdb6da3fa2d729bae0ae9c39fae615f
MD5 260f9f54dcaa413696f5f241fb7f06df
BLAKE2b-256 a3e3590199efa2e4df3d78e59a8306f21fbcb1aac5337a792d169bfe6116eef3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ner_entity_annotator-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad2928cbd3206487856edfd2475102e052e33af9c89026a5c89b52fde2fbfc0
MD5 3798afaee549c2fbecfeb5df833935ec
BLAKE2b-256 8def2ab7506ae2d52336d0f9e59aa9fe7c68bcf95e16cb678234b2952f83639b

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