publichealthsurveillance commited on
Commit
86bf09b
1 Parent(s): 516c3f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,10 +1,8 @@
1
  import ktrain
2
- from gradio.blocks import Blocks
3
- from gradio.interface import Interface, TabbedInterface
4
- from gradio.mix import Series, Parallel
5
 
6
- """
7
 
 
8
  examples = [
9
  ["I only get my kids the ones I got....I've turned down many so called 'vaccines'"],
10
  ["In child protective services, further providing for definitions, for immunity from liability"],
@@ -28,9 +26,9 @@ def PHSBERT(text):
28
  results = predictor_phs.predict(str(text))
29
  return str(results)
30
 
31
- bert_io = gr.Interface(fn=BERT, inputs="text", outputs="text")
32
- mental_io = gr.Interface(fn=MentalBERT, inputs="text", outputs="text")
33
- phs_io = gr.Interface(fn=PHSBERT, inputs="text", outputs="text")
34
 
35
  vs = Parallel(bert_io, mental_io, phs_io,
36
  examples=examples,
@@ -41,7 +39,7 @@ vs = Parallel(bert_io, mental_io, phs_io,
41
  def model(text):
42
  return "Predictions unavailable - to be completed."
43
 
44
- # hm = gr.Interface(fn=model, inputs="text", outputs="text")
45
 
46
  # interfaces = [vs, hm]
47
  # interface_names = ["Vaccine Sentiment Task", "Health Mention Task"]
 
1
  import ktrain
2
+ from gradio import Blocks, Interface, Parallel, Tabs, TabItem, Markdown
 
 
3
 
 
4
 
5
+ """
6
  examples = [
7
  ["I only get my kids the ones I got....I've turned down many so called 'vaccines'"],
8
  ["In child protective services, further providing for definitions, for immunity from liability"],
 
26
  results = predictor_phs.predict(str(text))
27
  return str(results)
28
 
29
+ bert_io = Interface(fn=BERT, inputs="text", outputs="text")
30
+ mental_io = Interface(fn=MentalBERT, inputs="text", outputs="text")
31
+ phs_io = Interface(fn=PHSBERT, inputs="text", outputs="text")
32
 
33
  vs = Parallel(bert_io, mental_io, phs_io,
34
  examples=examples,
 
39
  def model(text):
40
  return "Predictions unavailable - to be completed."
41
 
42
+ hm = Interface(fn=model, inputs="text", outputs="text")
43
 
44
  # interfaces = [vs, hm]
45
  # interface_names = ["Vaccine Sentiment Task", "Health Mention Task"]