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.4.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.4-py3-none-any.whl (846.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ner_entity_annotator-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 fa1ac9ae8dafa08a14ec8f61c1c721abe2d74e13e4b222f096deeb65e9f4cd4c
MD5 3e4babc22654fea057a8174e41dc8bfe
BLAKE2b-256 1a1bdcdc473d8ce031d665b72e75aa480b806d8efb4ab760dcec4c3e6afdf231

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ner_entity_annotator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5cfd8e83829c4fbdb149f514709655663368935beb1ce8b8987f24eac156c2e4
MD5 29140667b79cf3c81e77966285fc11cb
BLAKE2b-256 002d54f41b60d59250567b2c923643cdbe675c1d6c1c68df6fee073b181e0800

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