Sreekannan commited on
Commit
3008b7d
1 Parent(s): 563e6ac

Update emotion_analysis.py

Browse files
Files changed (1) hide show
  1. 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'] 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)
 
10
 
11
  def get_emotion(text):
12
  emotion_labels = emotion(text)
13
+ emotion_detail = [item['label'][0] 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)