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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: streamlit_text_label-0.1.2.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for streamlit_text_label-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ea6aaeeb7b941d42e7af8316f4225fb73514f7e5cce286e0869405bbe2795686
MD5 6fb1fc22555317146afbb4f4cc9f0d27
BLAKE2b-256 c9ffa05906845d2513b4fc7fe5776c2089265b23c7309ead8c7d1c9c655b49d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_text_label-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b06e09998faf2248b32d3ea2d0539f18acaf8a6d13e39296d704f680e50297e
MD5 8bb03c082e799690cef75b73a222e35c
BLAKE2b-256 25577bd97eeb217c44a346561fd02c1fc697ddd92694fff8c886adc5a3cac046

See more details on using hashes here.

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