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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ner_entity_annotator-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 dfd74381f3346233754f096bf223ee08976e8f5dba4ca6f5fb33b529edcf42e2
MD5 55526680fc9da20219020cf5209f5078
BLAKE2b-256 17b8ad780c8736fbf6a15db378ac1b3b648d4c462098114957b836c71534dcc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ner_entity_annotator-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2842b3815566831f099c3246f85b0bbe89794a6e963fa5b366f4609166692fef
MD5 5773d1c8e460780ed556ef2dbe17e07c
BLAKE2b-256 33b6b1de78bd62246e5cbb8fbfc9eac82703fb9244badbc6647d82c9bf76e76d

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