FahadAlam commited on
Commit
b413d58
1 Parent(s): a7e0158

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -2,10 +2,10 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  classifier = pipeline("text-classification",model='bhadresh-savani/distilbert-base-uncased-emotion', return_all_scores=True)
5
- output = {}
6
 
7
  def detect_emotions(emotion_input):
8
  prediction = classifier(emotion_input,)
 
9
  for emotion in prediction[0]:
10
  output[emotion["label"]] = emotion["score"]
11
  return output
 
2
  from transformers import pipeline
3
 
4
  classifier = pipeline("text-classification",model='bhadresh-savani/distilbert-base-uncased-emotion', return_all_scores=True)
 
5
 
6
  def detect_emotions(emotion_input):
7
  prediction = classifier(emotion_input,)
8
+ output = {}
9
  for emotion in prediction[0]:
10
  output[emotion["label"]] = emotion["score"]
11
  return output