carisackc commited on
Commit
09ba6ac
·
1 Parent(s): 0e49ad1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -224,7 +224,7 @@ def dedupe(items):
224
  yield item
225
  seen.add(item)
226
 
227
- lem_clinical_note= lemmatize(text, nlp0)
228
  #creating a doc object using BC5CDR model
229
  doc = nlp1(lem_clinical_note)
230
  options = get_entity_options()
@@ -238,7 +238,7 @@ matcher = match(nlp1, results0,"NEG_ENTITY")
238
  doc0 = overwrite_ent_lbl(matcher,doc)
239
 
240
  #visualizing identified Named Entities in clinical input text
241
- displacy.render(doc0, style='ent', options=options)
242
 
243
  ##======================== End of NER Tagging ========================
244
 
@@ -278,11 +278,12 @@ def run_model(input_text):
278
 
279
 
280
  st.success(output)
281
-
282
- doc = nlp(str(original_text2))
283
- colors = { "DISEASE": "pink","CHEMICAL": "orange"}
284
- options = {"ents": [ "DISEASE", "CHEMICAL"],"colors": colors}
285
- ent_html = displacy.render(doc, style="ent", options=options)
 
286
 
287
  col1, col2 = st.columns([1,1])
288
 
 
224
  yield item
225
  seen.add(item)
226
 
227
+ lem_clinical_note= lemmatize(runtext, nlp0)
228
  #creating a doc object using BC5CDR model
229
  doc = nlp1(lem_clinical_note)
230
  options = get_entity_options()
 
238
  doc0 = overwrite_ent_lbl(matcher,doc)
239
 
240
  #visualizing identified Named Entities in clinical input text
241
+ ent_html = displacy.render(doc0, style='ent', options=options)
242
 
243
  ##======================== End of NER Tagging ========================
244
 
 
278
 
279
 
280
  st.success(output)
281
+ # ====== Old NER ======
282
+ #doc = nlp(str(original_text2))
283
+ #colors = { "DISEASE": "pink","CHEMICAL": "orange"}
284
+ #options = {"ents": [ "DISEASE", "CHEMICAL"],"colors": colors}
285
+ #ent_html = displacy.render(doc, style="ent", options=options)
286
+ # ====== End of Old NER ======
287
 
288
  col1, col2 = st.columns([1,1])
289