medicalner / app.py
Wilame Lima
First commit
dafb744
raw
history blame
614 Bytes
from functions import *
# set the title
st.sidebar.title(DASHBOARD_TITLE)
# load the model
with st.spinner("Loading the model..."):
model = load_pipeline()
# input
text = st.text_area(value="Woman, 43, feeling pain in the stomach. No vomiting", label="Enter the text here")
submit = st.button("Submit")
if text and submit:
# get the entities
entities = model(text)
if len(entities) == 0:
st.error("No entities found")
# annotate the entities
annotated_entities = [annotate(entity) for entity in entities]
# display the entities
annotated_text(annotated_entities)