jonathanjordan21
commited on
Commit
•
cc6b847
1
Parent(s):
79fd2ad
Update app.py
Browse files
app.py
CHANGED
@@ -52,6 +52,6 @@ async def sentiment_score(text: str):
|
|
52 |
dim=-1
|
53 |
)
|
54 |
|
55 |
-
return [{"label":
|
56 |
|
57 |
|
|
|
52 |
dim=-1
|
53 |
)
|
54 |
|
55 |
+
return [{"label":sentiment_model.config.id2label[predicted_class_id.tolist()], "score":softmax[0, predicted_class_id].tolist()} for predicted_class_id in softmax.argsort(dim=-1, descending=True)[0]]
|
56 |
|
57 |
|