Components for labelling text document
Project description
# streamlit-text-label
Custom streamlit component for labelling text selections, based on [Label Studio](https://github.com/heartexlabs/label-studio-frontend).
![Demo](https://user-images.githubusercontent.com/1639722/136137713-752622a5-25f0-42b2-9645-a800674bff31.gif)
## Usage
Prerequisite:
- python >= 3.7
```python
from streamlit_text_label import label_select
selections = label_select(body="lorem ipsum", labels=["Noun", "Verb"])
```
More details in [example](example/app.py) directory.
## Develop
```bash
docker-compose up --build
```
Or manually, start the frontend
```bash
cd streamlit_text_label/frontend
npm install
npm run start
```
Followed by the example app
```bash
pip install -r example/requirements.txt
RELEASE=DEV streamlit run example/app.py
```
## Publish
```bash
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
Built Distribution
Close
Hashes for streamlit_text_label-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e312fdddeb009eb175893d294d7da10ea014c76769229cb05e9d6c65024d93f |
|
MD5 | e2ebcfb9631186c2c8b40d288832eb48 |
|
BLAKE2b-256 | e0a29d24d4df9277b08fd23c5430346a4fc8e54ab4c35a4c12d435205dba590c |
Close
Hashes for streamlit_text_label-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e9d4f70f14e234557c766a21b233bf993656bb94e66a71e454ca4304970fbe |
|
MD5 | 6f5e832a08588ee1721375bc198d7667 |
|
BLAKE2b-256 | ce8eb3a9c1934c896b0d65dcbc7608d2d70905502f4e21204ff162358787abcd |