sentivity commited on
Commit
2cbfc6f
·
verified ·
1 Parent(s): 0438422

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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() == 'positive':
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