Spaces:
Running
Running
Update app.py (#1)
Browse files- Update app.py (b116a1d49bbd73cd026108c68ac5c4247e1c4f50)
Co-authored-by: Abubakar Abid <abidlabs@users.noreply.huggingface.co>
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
whole-body deletion of the essential autophagy gene Atg7 in adult mice causes a systemic metabolic defect that manifests as starvation \
|
7 |
-
intolerance and gradual loss of white adipose tissue, liver glycogen and muscle mass. Cancer cells also benefit from autophagy."))
|
|
|
|
|
|
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="Autophagy maintains tumour growth through circulating arginine. Acute, \
|
10 |
whole-body deletion of the essential autophagy gene Atg7 in adult mice causes a systemic metabolic defect that manifests as starvation \
|
11 |
+
intolerance and gradual loss of white adipose tissue, liver glycogen and muscle mass. Cancer cells also benefit from autophagy."), outputs="highlightedtext")
|
12 |
+
|
13 |
+
interface.launch()
|