Spaces:
Runtime error
Runtime error
publichealthsurveillance
commited on
Commit
•
d2c2419
1
Parent(s):
90e8d13
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,8 @@ 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 |
-
|
8 |
-
|
9 |
predictor_phs = ktrain.load_predictor('phsbert')
|
10 |
|
11 |
def bert(text):
|
@@ -20,12 +20,8 @@ def phsbert(text):
|
|
20 |
results = predictor_phs.predict(str(text))
|
21 |
return str(results)
|
22 |
|
23 |
-
|
24 |
-
|
25 |
phs_io = gr.Interface(fn=phsbert, inputs="text", outputs="text")
|
26 |
|
27 |
-
|
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):
|
|
|
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, examples=examples, title="Title", description="desc").launch()
|
|
|
|
|
|
|
|