Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,9 @@ def predict(model, txt):
|
|
31 |
elif model == "cardiffnlp/twitter-roberta-base-sentiment-latest":
|
32 |
rob_res = pipe_roberta(txt)[0]
|
33 |
label_dict = {
|
34 |
-
"
|
35 |
-
"
|
36 |
-
"
|
37 |
}
|
38 |
label = label_dict[rob_res['label']]
|
39 |
score = rob_res['score']
|
|
|
31 |
elif model == "cardiffnlp/twitter-roberta-base-sentiment-latest":
|
32 |
rob_res = pipe_roberta(txt)[0]
|
33 |
label_dict = {
|
34 |
+
"neutral": 0,
|
35 |
+
"negative": 1,
|
36 |
+
"positive": -1
|
37 |
}
|
38 |
label = label_dict[rob_res['label']]
|
39 |
score = rob_res['score']
|