Skip to main content

Streamlit component that allows you to visualize and modify NER annotations

Project description

ner-span-annotator

This Streamlit component enables you to visualize Named Entity Recognition (NER) annotations in the spaCy displacy span style. Additionally, it allows you to modify NER annotations interactively.

https://github.com/forward-it/ner-span-annotator/raw/main/example.png

The implementation includes code partially ported from Python to React, based on the spaCy repository.

Installation instructions

pip install ner_span_annotator

Usage instructions

import streamlit as st

from ner_span_annotator import ner_span_annotator

spans = [
    {"start_token": 3, "end_token": 6, "label": "ORG"},
    {"start_token": 5, "end_token": 6, "label": "GPE"},
]
tokens = ["Welcome", "to", "the", "Bank", "of", "China", "."]

result = ner_span_annotator(tokens=tokens, spans=spans, labels=["ORG", "GPE"])

st.json(result)

Development

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

Navigate to the ner_span_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_span_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_span_annotator-0.1.2.tar.gz (840.9 kB view details)

Uploaded Source

Built Distribution

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

ner_span_annotator-0.1.2-py3-none-any.whl (846.2 kB view details)

Uploaded Python 3

File details

Details for the file ner_span_annotator-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for ner_span_annotator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8637945d94e2676d7f1398e4a99c45c1c9228515a2af9ff26fd91af3d59c7a1e
MD5 c93d7f5b7df4e654bf3b28aa265a8d56
BLAKE2b-256 8ec5d2d05a9c406dda6ef223393718ec137e06acc61350c8792263a559c4bfcf

See more details on using hashes here.

File details

Details for the file ner_span_annotator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ner_span_annotator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1aec28377eb6f5f2cd6a2f51696d59ae99b7c03afab9cfb733dc7dee392d31e3
MD5 4ba84357f74a76abe9fd76eda870053c
BLAKE2b-256 84e25c9551884783571df01ab916493c63897032fc5ea74969ca6b2d5226f165

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