Skip to main content

streamlit-annotation

Streamlit Annotation Tools

PyPI version Downloads Downloads Downloads

Streamlit Annotation Tools is a Streamlit component that gives you access to various annotation tools (labeling, annotation, etc.) for text data.

Demo

Try

Open in Streamlit

Text Highlighter

Text Labeler

Install

pip install streamlit-annotation-tools

Quick Use

Text Highlighter

Create an example.py file

from streamlit_annotation_tools import text_highlighter

text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean et hendrerit orci. Praesent auctor malesuada lobortis. Suspendisse ac elit bibendum, congue tellus vel, ornare ipsum. Mauris at tellus in turpis aliquet cursus."

annotations = text_highlighter(text)

Run:

streamlit run example.py

Output:

[
  [
    {"start": 0, "end": 5, "label": "Lorem"},
    {"start": 12, "end": 17, "label": "dolor"},
  ],
  [
    {"start": 6, "end": 11, "label": "ipsum"},
    {"start": 18, "end": 21, "label": "sit"},
  ],
]

Text Labeler

Create an example.py file

from streamlit_annotation_tools import text_labeler

text = "Yesterday, at 3 PM, Emily Johnson and Michael Smith met at the Central Park in New York to discuss the merger between TechCorp and Global Solutions. The deal, worth approximately 500 million dollars, is expected to significantly impact the tech industry. Later, at 6 PM, they joined a conference call with the CEO of TechCorp, David Brown, who was in London for a technology summit. During the call, they discussed the market trends in Asia and Europe and planned for the next quarterly meeting, which is scheduled for January 15th, 2024, in Paris."

labels = text_labeler(text)

Run:

streamlit run example.py

Output:

{
    "Personal names": [
        {"start": 20, "end": 33, "label": "Emily Johnson"},
        {"start": 38, "end": 51, "label": "Michael Smith"},
        {"start": 327, "end": 338, "label": "David Brown"},
    ],
    "Organizations": [
        {"start": 118, "end": 126, "label": "TechCorp"},
        {"start": 131, "end": 147, "label": "Global Solutions"},
    ],
    "Locations": [
        {"start": 63, "end": 75, "label": "Central Park"},
        {"start": 79, "end": 87, "label": "New York"},
        {"start": 351, "end": 357, "label": "London"},
        {"start": 436, "end": 440, "label": "Asia"},
        {"start": 445, "end": 451, "label": "Europe"},
        {"start": 542, "end": 547, "label": "Paris"},
    ],
    "Time": [
        {"start": 0, "end": 9, "label": "Yesterday"},
        {"start": 14, "end": 18, "label": "3 PM"},
        {"start": 265, "end": 269, "label": "6 PM"},
        {"start": 519, "end": 531, "label": "January 15th"},
        {"start": 533, "end": 537, "label": "2024"},
    ],
    "Money": [{"start": 179, "end": 198, "label": "500 million dollars"}],
}

Development

Install

git clone git@github.com:rmarquet21/streamlit-annotation-tools.git
cd streamlit-annotation-tools
pip install -e .

Run

streamlit run example.py

License

MIT

Author

Robin Marquet

Contributors

Metadata

Release files for streamlit-annotation-tools 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-annotation-tools 1.0.1
File Size Uploaded Provenance Actions
streamlit_annotation_tools-1.0.1.tar.gz 418.5 kB Without provenance Details for streamlit_annotation_tools-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-annotation-tools 1.0.1
File Interpreter ABI Platform Actions
streamlit_annotation_tools-1.0.1-py3-none-any.whl Python 3 none any Details for streamlit_annotation_tools-1.0.1-py3-none-any.whl

Total release size: 848.4 kB

Release files / streamlit_annotation_tools-1.0.1.tar.gz

Download URL streamlit_annotation_tools-1.0.1.tar.gz
Size 418.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a6e8cf0ea57f47fada3cbfa6f0656cf3a5c940b20ae2db4699f55e57a0417a3
BLAKE2b-256 checksum
How to use checksums
44b6f857280587c2cca862ff70942b2443eb50d352746cf5ccfc7bdd7907520f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

Release files / streamlit_annotation_tools-1.0.1-py3-none-any.whl

Download URL streamlit_annotation_tools-1.0.1-py3-none-any.whl
Size 429.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3022565bed09b13ab700a5983adb3643acfb6681fe7a4f7501b696142912f6f0
BLAKE2b-256 checksum
How to use checksums
d941794d4e554c6b7aef075175f999cb86305bb4bbc5355cccfc2fbc4c2d2cc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

Security for streamlit-annotation-tools 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page