publichealthsurveillance commited on
Commit
0d42ce8
1 Parent(s): 4f7adab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -4,9 +4,9 @@ from gradio.mix import Parallel
4
 
5
  examples = [["I only get my kids the ones I got....I've turned down many so called 'vaccines'"], ["In child protective services, further providing for definitions, for immunity from liability"], ["Lol what? Measles is a real thing. Get vaccinated"]]
6
 
7
- predictor_bert = ktrain.load_predictor('bert')
8
- predictor_mental = ktrain.load_predictor('mentalbert')
9
- # predictor_phs = ktrain.load_predictor('phsbert')
10
 
11
  def bert(text):
12
  results = predictor_bert.predict(str(text))
@@ -17,15 +17,16 @@ def mentalbert(text):
17
  return str(results)
18
 
19
  def phsbert(text):
20
- results = predictor_phs.predict(str(text))
21
- return str(results)
 
22
 
23
- bert_io = gr.Interface(fn=bert, inputs="text", outputs="text")
24
- mental_io = gr.Interface(fn=mentalbert, inputs="text", outputs="text")
25
- # phs_io = gr.Interface(fn=phsbert, inputs="text", outputs="text")
26
 
27
  # Parallel(bert_io, mental_io, phs_io).launch()
28
- Parallel(bert_io, mental_io, examples=examples).launch()
29
  # bert_io.launch()
30
  # mental_io.launch()
31
- # phs_io.launch()
 
4
 
5
  examples = [["I only get my kids the ones I got....I've turned down many so called 'vaccines'"], ["In child protective services, further providing for definitions, for immunity from liability"], ["Lol what? Measles is a real thing. Get vaccinated"]]
6
 
7
+ # predictor_bert = ktrain.load_predictor('bert')
8
+ # predictor_mental = ktrain.load_predictor('mentalbert')
9
+ predictor_phs = ktrain.load_predictor('phsbert')
10
 
11
  def bert(text):
12
  results = predictor_bert.predict(str(text))
 
17
  return str(results)
18
 
19
  def phsbert(text):
20
+ return str(predictor_phs)
21
+ # results = predictor_phs.predict(str(text))
22
+ # return str(results)
23
 
24
+ # bert_io = gr.Interface(fn=bert, inputs="text", outputs="text")
25
+ # mental_io = gr.Interface(fn=mentalbert, inputs="text", outputs="text")
26
+ phs_io = gr.Interface(fn=phsbert, inputs="text", outputs="text")
27
 
28
  # Parallel(bert_io, mental_io, phs_io).launch()
29
+ # Parallel(bert_io, mental_io, examples=examples).launch()
30
  # bert_io.launch()
31
  # mental_io.launch()
32
+ phs_io.launch()