andrewgleave commited on
Commit
58c1264
·
1 Parent(s): bdf7636
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -5,11 +5,8 @@ import gradio as gr
5
 
6
  def ner(text):
7
  api = gr.Interface.load("d4data/biomedical-ner-all", src="models")
8
- output = api(text)
9
- replaced_spans = [
10
- (key, None) if value == "No Disease" else (key, value) for (key, value) in spans
11
- ]
12
- return replaced_spans
13
 
14
 
15
  EXAMPLE_TEXTS = []
@@ -21,7 +18,7 @@ with open("examples.json", "r") as f:
21
  interface = gr.Interface(
22
  ner,
23
  inputs=gr.Textbox(label="Input", value=""),
24
- outputs="highlightedtext",
25
  examples=EXAMPLE_TEXTS,
26
  )
27
 
 
5
 
6
  def ner(text):
7
  api = gr.Interface.load("d4data/biomedical-ner-all", src="models")
8
+ result = api(text)
9
+ return result
 
 
 
10
 
11
 
12
  EXAMPLE_TEXTS = []
 
18
  interface = gr.Interface(
19
  ner,
20
  inputs=gr.Textbox(label="Input", value=""),
21
+ outputs=["highlighttext", "json"],
22
  examples=EXAMPLE_TEXTS,
23
  )
24