A simple component to display annotated text in Streamlit apps. For example:
Or, even better, check out our demo app here:
First install Streamlit (of course!) then pip-install this library:
pip install streamlit
pip install st-annotated-text
import streamlit as st
from annotated_text import annotated_text
annotated_text(
"This ",
("is", "verb"),
" some ",
("annotated", "adj"),
("text", "noun"),
" for those of ",
("you", "pronoun"),
" who ",
("like", "verb"),
" this sort of ",
("thing", "noun"),
"."
)
For more examples, including :sparkles:customization options:sparkles:, see the demo app.
The annotated_text()
function accepts any number of the following arguments:
annotation()
function from this
module to easily produce annotations whose CSS you can customize via keyword arguments.