abhibisht89 commited on
Commit
cb734d2
·
1 Parent(s): 109a4e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,5 +1,6 @@
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,9 +25,9 @@ def get_med7_ent(text):
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
 
 
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
 
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