Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,12 +60,12 @@ def predict_sentiment(text):
|
|
60 |
ranking = ranking[::-1]
|
61 |
negative_index = None
|
62 |
for i in range(scores.shape[0]):
|
63 |
-
if config.id2label[ranking[i]] == '
|
64 |
negative_index = ranking[i]
|
65 |
break
|
66 |
negative_score = scores[negative_index]
|
67 |
|
68 |
-
return negative_score
|
69 |
|
70 |
|
71 |
|
|
|
60 |
ranking = ranking[::-1]
|
61 |
negative_index = None
|
62 |
for i in range(scores.shape[0]):
|
63 |
+
if config.id2label[ranking[i]] == 'positive':
|
64 |
negative_index = ranking[i]
|
65 |
break
|
66 |
negative_score = scores[negative_index]
|
67 |
|
68 |
+
return float(negative_score)*100
|
69 |
|
70 |
|
71 |
|