MateusA commited on
Commit
caa7d9d
1 Parent(s): 76f6364

Created app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def ner(text):
4
+ api = gr.Interface.load("ugaray96/biobert_ncbi_disease_ner", src='models')
5
+ spans = api(text)
6
+ replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
7
+ return replaced_spans
8
+
9
+ interface = gr.Interface(ner, inputs=gr.Textbox(label="Input", value="Patient is 50 yo M experienced a right bundle branch block (RBBB) yet tests for arrythmia found no results and heart health. Top goals."), outputs="highlightedtext")
10
+
11
+ interface.launch()