Spaces:
Build error
Build error
Commit
·
6eb7202
1
Parent(s):
3008b7d
Update emotion_analysis.py
Browse files- emotion_analysis.py +1 -1
emotion_analysis.py
CHANGED
|
@@ -10,7 +10,7 @@ emotion = pipeline('sentiment-analysis',
|
|
| 10 |
|
| 11 |
def get_emotion(text):
|
| 12 |
emotion_labels = emotion(text)
|
| 13 |
-
emotion_detail = [item['label']
|
| 14 |
print("The detected emotion is:", emotion_detail)
|
| 15 |
confidence_score = str(round([item['score'] for item in emotion_labels][0]*100, 2)) + "%"
|
| 16 |
print("The confidence score is:", confidence_score)
|
|
|
|
| 10 |
|
| 11 |
def get_emotion(text):
|
| 12 |
emotion_labels = emotion(text)
|
| 13 |
+
emotion_detail = [item['label'] for item in emotion_labels]
|
| 14 |
print("The detected emotion is:", emotion_detail)
|
| 15 |
confidence_score = str(round([item['score'] for item in emotion_labels][0]*100, 2)) + "%"
|
| 16 |
print("The confidence score is:", confidence_score)
|