abhibisht89 commited on
Commit
3dc0f32
β€’
1 Parent(s): f865b2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -16,23 +16,15 @@ def get_med7_ent(text):
16
  col_dict[label] = colour
17
 
18
  options = {'ents': med7.pipe_labels['ner'], 'colors':col_dict}
19
-
20
- # text = 'A patient was prescribed Magnesium hydroxide 400mg/5ml suspension PO of total 30ml bid for the next 5 days.'
21
  doc = med7(text)
22
-
23
- # spacy.displacy.render(doc, style='ent', jupyter=True, options=options)
24
-
25
- # [(ent.text, ent.label_) for ent in doc.ents]
26
-
27
  html = displacy.render(doc, style='ent',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
 
33
- desc="Med7 β€” an information extraction model for clinical natural language processing"
34
 
35
- inp=gr.inputs.Textbox(lines=5, placeholder=None, default="", label="text to extract Med7 Entities")
36
  out=gr.outputs.HTML(label=None)
37
 
38
  iface = gr.Interface(fn=get_med7_ent, inputs=inp, outputs=out,examples=exp,article=desc,title="Med7",theme="huggingface",layout='horizontal')
 
16
  col_dict[label] = colour
17
 
18
  options = {'ents': med7.pipe_labels['ner'], 'colors':col_dict}
 
 
19
  doc = med7(text)
 
 
 
 
 
20
  html = displacy.render(doc, style='ent',options=options)
 
21
  return html
22
 
23
  exp=["A patient was prescribed Magnesium hydroxide 400mg/5ml suspension PO of total 30ml bid for the next 5 days."]
24
 
25
+ desc="Med7 β€” An information extraction model for clinical natural language processing. More information about the model development can be found in recent pre-print: Med7: a transferable clinical natural language processing model for electronic health records."
26
 
27
+ inp=gr.inputs.Textbox(lines=5, placeholder=None, default="", label="Text")
28
  out=gr.outputs.HTML(label=None)
29
 
30
  iface = gr.Interface(fn=get_med7_ent, inputs=inp, outputs=out,examples=exp,article=desc,title="Med7",theme="huggingface",layout='horizontal')