Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -79,11 +79,11 @@ def predict_sentiment(text):
|
|
79 |
ranking = ranking[::-1]
|
80 |
negative_id = -1
|
81 |
for idx, label in config.id2label.items():
|
82 |
-
if label.lower() == '
|
83 |
negative_id = idx
|
84 |
negative_score = scores[negative_id]
|
85 |
|
86 |
-
return (float(negative_score))*100
|
87 |
|
88 |
|
89 |
|
|
|
79 |
ranking = ranking[::-1]
|
80 |
negative_id = -1
|
81 |
for idx, label in config.id2label.items():
|
82 |
+
if label.lower() == 'negative':
|
83 |
negative_id = idx
|
84 |
negative_score = scores[negative_id]
|
85 |
|
86 |
+
return (1-(float(negative_score)))*100
|
87 |
|
88 |
|
89 |
|