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

Uploaded Python 3

File details

Details for the file ner-entity-annotator-0.0.1.tar.gz.

File metadata

  • Download URL: ner-entity-annotator-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 106b90d286611a3e131994d7cd0cba69c259a5eaf5df23780de87a76a7881d9c
MD5 fe0c4539a8f7ae2ef85155806c47f82c
BLAKE2b-256 5014d7a85a81bf895e313b11960b885bac0a4a2ff956ddf7f161c15037022c6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ner_entity_annotator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb6b1df57e1169fb647be5810dc865b8f88a6cbe21bfc7bcd34b29f49319d349
MD5 53378291f497a0db5ac419573eec6607
BLAKE2b-256 04c6d9b37fbbc9b51b93567545848cb5a7b9ecd904df2dbb74016b1bc7fa6b36

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