Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,12 +16,12 @@ class EmotionClassifier:
|
|
| 16 |
def predict(self, input_text: str):
|
| 17 |
pred = self.pipeline(input_text)[0]
|
| 18 |
result = {
|
| 19 |
-
"Sadness
|
| 20 |
-
"Joy
|
| 21 |
-
"Love
|
| 22 |
-
"Anger
|
| 23 |
"Fear π¨": pred[4]["score"],
|
| 24 |
-
"Surprise
|
| 25 |
}
|
| 26 |
return result
|
| 27 |
|
|
|
|
| 16 |
def predict(self, input_text: str):
|
| 17 |
pred = self.pipeline(input_text)[0]
|
| 18 |
result = {
|
| 19 |
+
"Sadness π’": pred[0]["score"],
|
| 20 |
+
"Joy π": pred[1]["score"],
|
| 21 |
+
"Love π₯°": pred[2]["score"],
|
| 22 |
+
"Anger π€¬": pred[3]["score"],
|
| 23 |
"Fear π¨": pred[4]["score"],
|
| 24 |
+
"Surprise π―": pred[5]["score"],
|
| 25 |
}
|
| 26 |
return result
|
| 27 |
|