File size: 614 Bytes
dafb744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)