New component: NLP annotation tools

:star2::wave: Hello everyone! :wave::star2:

I’m excited to share some updates to my text highlighting and labeling component! :rocket: This tool is your go-to resource for easy and efficient annotation. I plan to improve it and add new components in the future.

:link: Check it out:

  • GitHub (Don’t forget to :star: the repo to support!): link
  • PyPI: link
  • Live Demo: link

:hammer_and_wrench: Here’s what you can do with these tools:

  • Highlighting Tools: Make your text stand out! :crayon: See how it works:

    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)


  • Labeling Tools: Organize and categorize with ease! :label:

    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)


:star: Your stars on GitHub are much appreciated! They help keep the project growing. :seedling:

:computer: Easy Installation :

pip install streamlit-annotation-tools

:raised_hands: I’m open to ideas !

please try to add drag and drop functionality:

Q. ChatGPT is a … developed by … and launched on November 30, 2022. Based on a … , it enables users to refine and steer a conversation towards a desired length, format, style, level of detail,

a. chatbot
b. OpenAI
c. large language model

The use can drag and drop the answers to the Question section…
Hope it makes sense.

Thanks for the idea, but could you give me more details on the use case of this component for text annotation?

Like a quiz app where we can drag the answers to the fill in blank spaces.

Nice - would be great if you can support import and export of annotations, and stepping through annotations. Also good if the annotation format worked with a tool like spaCy, and also to allow annotations to be run iteratively over multiple sessions. Some sort of evaluation/training mode would be great, where the annotations can be supplied by an external model (essentially a variation of the import + stepping through).

Thank you for your feedback !

For the annotation import and export part, this is already the case, but it’s true that I forgot to document it, but it’s still possible to find the implementation on the GitHub repo in examples.

    text = "Lorem ipsum dolor sit et amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."

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

    highlights = text_highlighter(text, highlights)

As for the rest, I’ll have to read up on spacy to learn more first.

1 Like