Spaces:
Sleeping
Sleeping
Wilame Lima
commited on
Commit
·
fc751ee
1
Parent(s):
dafb744
Style
Browse files
app.py
CHANGED
@@ -3,11 +3,21 @@ from functions import *
|
|
3 |
# set the title
|
4 |
st.sidebar.title(DASHBOARD_TITLE)
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
# load the model
|
7 |
with st.spinner("Loading the model..."):
|
8 |
model = load_pipeline()
|
9 |
|
10 |
# input
|
|
|
11 |
text = st.text_area(value="Woman, 43, feeling pain in the stomach. No vomiting", label="Enter the text here")
|
12 |
submit = st.button("Submit")
|
13 |
|
@@ -23,6 +33,8 @@ if text and submit:
|
|
23 |
annotated_entities = [annotate(entity) for entity in entities]
|
24 |
|
25 |
# display the entities
|
26 |
-
|
|
|
|
|
27 |
|
28 |
|
|
|
3 |
# set the title
|
4 |
st.sidebar.title(DASHBOARD_TITLE)
|
5 |
|
6 |
+
# add an explanation of what is NER and why it is important for medical tasks
|
7 |
+
st.sidebar.markdown(
|
8 |
+
"""
|
9 |
+
Named Entity Recognition (NER) is a subtask of information extraction that locates and classifies named entities mentioned in unstructured text into pre-defined categories such as the names of persons, organizations, locations, expressions of times, quantities, monetary values, percentages, etc.
|
10 |
+
|
11 |
+
In the medical domain, NER can be used to extract entities such as symptoms, diseases, treatments, and more. This can be useful for various tasks such as clinical decision support, medical coding, and more.
|
12 |
+
"""
|
13 |
+
)
|
14 |
+
|
15 |
# load the model
|
16 |
with st.spinner("Loading the model..."):
|
17 |
model = load_pipeline()
|
18 |
|
19 |
# input
|
20 |
+
st.info("Enter the text in the text area below and click on submit to extract the entities")
|
21 |
text = st.text_area(value="Woman, 43, feeling pain in the stomach. No vomiting", label="Enter the text here")
|
22 |
submit = st.button("Submit")
|
23 |
|
|
|
33 |
annotated_entities = [annotate(entity) for entity in entities]
|
34 |
|
35 |
# display the entities
|
36 |
+
st.header("Found Entities")
|
37 |
+
for an_entity in annotated_entities:
|
38 |
+
annotated_text(an_entity)
|
39 |
|
40 |
|