Spaces:
Running
Running
File size: 724 Bytes
533422f 587ce47 83a2e7b 587ce47 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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="Autophagy maintains tumour growth through circulating arginine. Acute, \
whole-body deletion of the essential autophagy gene Atg7 in adult mice causes a systemic metabolic defect that manifests as starvation \
intolerance and gradual loss of white adipose tissue, liver glycogen and muscle mass. Cancer cells also benefit from autophagy."), outputs="highlightedtext")
interface.launch() |