Skip to main content

Components for labelling text document

Project description

streamlit-text-label

Custom streamlit component for labelling text selections, based on Label Studio. Demo

Usage

Prerequisite:

  • python >= 3.7
from streamlit_text_label import label_select

selections = label_select(body="lorem ipsum", labels=["Noun", "Verb"])

More details in example directory.

Develop

docker-compose up --build

Or manually, start the frontend

cd streamlit_text_label/frontend
npm install
npm run start

Followed by the example app

pip install -r example/requirements.txt
RELEASE=DEV streamlit run example/app.py

Publish

cd component/frontend
npm run build
cd ../..
python setup.py sdist bdist_wheel

Known Issues

  • Labelling standalone whitespaces will not work.
  • Trailing and leading whitespace will be included in selection but not rendered.
  • Label colors are generated from the first 6 characters of its own MD5 hash, which may clash and have low contrast (native HSL doesn't work fully with LS).
  • Each selection renders best with 1 label only. If you need multiple labels, create multiple selections.

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

streamlit_text_label-0.1.2.tar.gz (2.5 MB view hashes)

Uploaded Source

Built Distribution

streamlit_text_label-0.1.2-py3-none-any.whl (2.5 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page