fix emotion classification
Browse files- emotions.py +1 -1
emotions.py
CHANGED
@@ -7,7 +7,7 @@ classifier = pipeline("text-classification",
|
|
7 |
|
8 |
def get_emotion(text='No text yet'):
|
9 |
prediction = classifier(text)[0]
|
10 |
-
result = sorted(prediction, key=lambda x: x['score'])
|
11 |
return result
|
12 |
|
13 |
|
|
|
7 |
|
8 |
def get_emotion(text='No text yet'):
|
9 |
prediction = classifier(text)[0]
|
10 |
+
result = sorted(prediction, key=lambda x: x['score'])[::-1]
|
11 |
return result
|
12 |
|
13 |
|