Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -151,7 +151,9 @@ def genEntities(ann, entity):
|
|
151 |
ent = list(trans_df[trans_df['Class']==entity]['Entity'].unique())
|
152 |
entlist = ",".join(ent)
|
153 |
st.markdown(f'<p style="background-color:{ent_col[entity]};color:#080808;font-size:16px;">{entlist}</p>', unsafe_allow_html=True)
|
154 |
-
|
|
|
|
|
155 |
#lemmatizing the notes to capture all forms of negation(e.g., deny: denies, denying)
|
156 |
def lemmatize(note, nlp):
|
157 |
doc = nlp(note)
|
@@ -224,7 +226,7 @@ def dedupe(items):
|
|
224 |
yield item
|
225 |
seen.add(item)
|
226 |
|
227 |
-
lem_clinical_note= lemmatize(
|
228 |
#creating a doc object using BC5CDR model
|
229 |
doc = nlp1(lem_clinical_note)
|
230 |
options = get_entity_options()
|
@@ -240,7 +242,8 @@ doc0 = overwrite_ent_lbl(matcher,doc)
|
|
240 |
#visualizing identified Named Entities in clinical input text
|
241 |
displacy.render(doc0, style='ent', options=options)
|
242 |
|
243 |
-
|
|
|
244 |
def visualize (run_text,output):
|
245 |
text =''
|
246 |
splitruntext = [x for x in runtext.split('.')]
|
|
|
151 |
ent = list(trans_df[trans_df['Class']==entity]['Entity'].unique())
|
152 |
entlist = ",".join(ent)
|
153 |
st.markdown(f'<p style="background-color:{ent_col[entity]};color:#080808;font-size:16px;">{entlist}</p>', unsafe_allow_html=True)
|
154 |
+
|
155 |
+
|
156 |
+
##======================== Start of NER Tagging ========================
|
157 |
#lemmatizing the notes to capture all forms of negation(e.g., deny: denies, denying)
|
158 |
def lemmatize(note, nlp):
|
159 |
doc = nlp(note)
|
|
|
226 |
yield item
|
227 |
seen.add(item)
|
228 |
|
229 |
+
lem_clinical_note= lemmatize(runtext, nlp0)
|
230 |
#creating a doc object using BC5CDR model
|
231 |
doc = nlp1(lem_clinical_note)
|
232 |
options = get_entity_options()
|
|
|
242 |
#visualizing identified Named Entities in clinical input text
|
243 |
displacy.render(doc0, style='ent', options=options)
|
244 |
|
245 |
+
##======================== End of NER Tagging ========================
|
246 |
+
|
247 |
def visualize (run_text,output):
|
248 |
text =''
|
249 |
splitruntext = [x for x in runtext.split('.')]
|