mohamedali commited on
Commit
f48b4c4
1 Parent(s): 27c81aa

Create new file

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()