abhibisht89 commited on
Commit
4f6eb0d
1 Parent(s): 7fc2bf9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import os
2
  os.system('pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl')
3
- from IPython.core.display import display, HTML
4
 
5
  import gradio as gr
6
  from spacy import displacy
@@ -25,9 +24,9 @@ def get_med7_ent(text):
25
 
26
  # [(ent.text, ent.label_) for ent in doc.ents]
27
 
28
- html = displacy.render(doc, style="ent", options=options)
29
  print([(ent.text, ent.label_) for ent in doc.ents])
30
- return display(HTML(html))
31
 
32
  exp=["A patient was prescribed Magnesium hydroxide 400mg/5ml suspension PO of total 30ml bid for the next 5 days."]
33
 
 
1
  import os
2
  os.system('pip install https://huggingface.co/kormilitzin/en_core_med7_lg/resolve/main/en_core_med7_lg-any-py3-none-any.whl')
 
3
 
4
  import gradio as gr
5
  from spacy import displacy
 
24
 
25
  # [(ent.text, ent.label_) for ent in doc.ents]
26
 
27
+ html = displacy.render(doc, style='ent', jupyter=True, options=options)
28
  print([(ent.text, ent.label_) for ent in doc.ents])
29
+ return html
30
 
31
  exp=["A patient was prescribed Magnesium hydroxide 400mg/5ml suspension PO of total 30ml bid for the next 5 days."]
32