st_ner_annotate
st_ner_annotate copied to clipboard
Streamlit Named Entity Recognition (NER) annotation custom component
Streamlit Named Entity Recognition (NER) Annotation component
This is a component to assist with the annotation of named entities in an unstructured piece of text. The concept for this is borrowed from what is offered by Prodi.gy. This code is derived from the work done by andfalino in his excellent streamlit-named-entity-svelte repository.
The functionality has been expanded to allow for selecting of new entities and uses the streamlit-component-svelte-template.
I am also using this component as a testbed to get familiar with streamlit custom components and svelte.
NOTE This is a work in progress
Development
- Backend
- Install Poetry
- Run
poetry intall - Drop into a virtualenv shell
poetry shell - Install a spacy model
python -m spacy download en_core_web_sm - Edit
st_ner_annotate/__init__.pychange_RELEASEtoFalse - Run
streamlit run st_ner_annotate/__init__.py
- Frontend
cd st_codemirror_diff/frontendnpm installnpm start
- Now the frontend and backend should be up, the page can be accessed at
http://localhost:8501
Development - Release
- Frontend
- Run
npm run buildinst_ner_annotate/frontend
- Run
- Backend
- Edit
st_ner_annotate/__init__.pychange_RELEASEtoTrue - Drop into python virtualenv by running
poetry shell - Build python dist wheels
python setup.py sdist bdist_wheel - This will create the python
st_ner_annotate-<version>-py3-none-any.whlin thedistdir - Now install this via
python -m pip install <path-to-st_ner_annotate.whl>
- Edit
Demo

References
- Prodi.gy
- streamlit-named-entity-svelte
- streamlit-component-svelte-template
- Text sample in demo taken from wiki entry on Manhattan