Update app.py
Browse files
app.py
CHANGED
@@ -76,7 +76,7 @@ def preprocess(text):
|
|
76 |
return " ".join(ptokens)
|
77 |
|
78 |
|
79 |
-
def predict_sentiment(sentence):
|
80 |
sentence = preprocess(sentence)
|
81 |
|
82 |
model_path = config.MODEL_PATH
|
@@ -95,7 +95,7 @@ def predict_sentiment(sentence):
|
|
95 |
outputs, [] = engine.predict_fn(test_data_loader, model, device)
|
96 |
|
97 |
print(outputs)
|
98 |
-
return outputs #{"label":outputs[0]}
|
99 |
|
100 |
|
101 |
|
|
|
76 |
return " ".join(ptokens)
|
77 |
|
78 |
|
79 |
+
def predict_sentiment(sentence = ""):
|
80 |
sentence = preprocess(sentence)
|
81 |
|
82 |
model_path = config.MODEL_PATH
|
|
|
95 |
outputs, [] = engine.predict_fn(test_data_loader, model, device)
|
96 |
|
97 |
print(outputs)
|
98 |
+
return label_full_decoder(outputs[0]) #{"label":outputs[0]}
|
99 |
|
100 |
|
101 |
|