publichealthsurveillance commited on
Commit
2aecf78
1 Parent(s): 8a7a147

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -2,9 +2,9 @@ import ktrain
2
  import gradio as gr
3
  from gradio.mix import Parallel
4
 
5
- predictor_bert = ktrain.load_predictor('bert')
6
- predictor_mental = ktrain.load_predictor('mentalbert')
7
- # predictor_phs = ktrain.load_predictor('phsbert')
8
 
9
  def func_bert(text):
10
  results = predictor_bert.predict(str(text))
@@ -18,12 +18,12 @@ def func_phs(text):
18
  results = predictor_phs.predict(str(text))
19
  return str(results)
20
 
21
- bert_io = gr.Interface(fn=func_bert, inputs="text", outputs="text")
22
- mental_io = gr.Interface(fn=func_mental, inputs="text", outputs="text")
23
- # phs_io = gr.Interface(fn=func_phs, inputs="text", outputs="text")
24
 
25
  # Parallel(bert_io, mental_io, phs_io).launch()
26
- Parallel(bert_io, mental_io).launch()
27
  # bert_io.launch()
28
  # mental_io.launch()
29
- # phs_io.launch()
 
2
  import gradio as gr
3
  from gradio.mix import Parallel
4
 
5
+ # predictor_bert = ktrain.load_predictor('bert')
6
+ # predictor_mental = ktrain.load_predictor('mentalbert')
7
+ predictor_phs = ktrain.load_predictor('phsbert')
8
 
9
  def func_bert(text):
10
  results = predictor_bert.predict(str(text))
 
18
  results = predictor_phs.predict(str(text))
19
  return str(results)
20
 
21
+ # bert_io = gr.Interface(fn=func_bert, inputs="text", outputs="text")
22
+ # mental_io = gr.Interface(fn=func_mental, inputs="text", outputs="text")
23
+ phs_io = gr.Interface(fn=func_phs, inputs="text", outputs="text")
24
 
25
  # Parallel(bert_io, mental_io, phs_io).launch()
26
+ # Parallel(bert_io, mental_io).launch()
27
  # bert_io.launch()
28
  # mental_io.launch()
29
+ phs_io.launch()