tvst / st-annotated-text

A simple component to display annotated text in Streamlit apps.
Apache License 2.0
525 stars 41 forks source link

Feature Request: Annotate parts of a string based on index value #33

Open sanwal-clarifai opened 1 year ago

sanwal-clarifai commented 1 year ago

Consider we have this text

In July, a company tied to Evan Spiegel, the co-founder and CEO of Snap, closed on the $119.868 million purchase of a Holmby Hills estate in Los Angeles, according to property records and people familiar with the situation. \n\n\n'

We run this through an NER model and get back the indexes of the string where we can highlight specific portions of the string with ids. So we know, for example that from index 141:152 is "Los Angeles" which is a Location. So instead of having to string concatenate the final output, create an output where you can take in string index as well as ids and annotate them as such.

You can recreate this result using Clarifai's NER model listed here.