Spaces:
Runtime error
Runtime error
publichealthsurveillance
commited on
Commit
•
6b3f9b7
1
Parent(s):
01c499a
Update app.py
Browse files
app.py
CHANGED
@@ -82,14 +82,22 @@ vs_predictor_bert = ktrain.load_predictor(folder + "bert")
|
|
82 |
vs_predictor_mental = ktrain.load_predictor(folder + "mentalbert")
|
83 |
vs_predictor_phs = ktrain.load_predictor(folder + "phsbert")
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
def vs_BERT(text):
|
86 |
-
return "BERT
|
87 |
|
88 |
def vs_MentalBERT(text):
|
89 |
-
return "MentalBERT
|
90 |
|
91 |
def vs_PHSBERT(text):
|
92 |
-
return "PHS-BERT
|
93 |
|
94 |
vs_bert_io = Interface(fn=vs_BERT, inputs="text", outputs="text")
|
95 |
vs_mental_io = Interface(fn=vs_MentalBERT, inputs="text", outputs="text")
|
|
|
82 |
vs_predictor_mental = ktrain.load_predictor(folder + "mentalbert")
|
83 |
vs_predictor_phs = ktrain.load_predictor(folder + "phsbert")
|
84 |
|
85 |
+
def vs_output(number):
|
86 |
+
if int(number) == 0:
|
87 |
+
return "vaccine critical"
|
88 |
+
if int(number) == 1:
|
89 |
+
return "neutral"
|
90 |
+
if int(number) == 2:
|
91 |
+
return "vaccine supportive"
|
92 |
+
|
93 |
def vs_BERT(text):
|
94 |
+
return "BERT ➡" + vs_output(vs_predictor_bert.predict(str(text)))
|
95 |
|
96 |
def vs_MentalBERT(text):
|
97 |
+
return "MentalBERT ➡" + vs_output(vs_predictor_mental.predict(str(text)))
|
98 |
|
99 |
def vs_PHSBERT(text):
|
100 |
+
return "PHS-BERT ➡" + vs_output(vs_predictor_phs.predict(str(text)))
|
101 |
|
102 |
vs_bert_io = Interface(fn=vs_BERT, inputs="text", outputs="text")
|
103 |
vs_mental_io = Interface(fn=vs_MentalBERT, inputs="text", outputs="text")
|