File size: 522 Bytes
40a218d
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr

def ner(text):
    api = gr.Interface.load("ugaray96/biobert_ncbi_disease_ner", src='models')
    spans = api(text)
    replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
    return replaced_spans

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

interface.launch()