X1ng1 commited on
Commit
c537fba
·
verified ·
1 Parent(s): aa6ac11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,11 +4,12 @@ import gradio as gr
4
  pipe = pipeline("text-classification", model="michellejieli/emotion_text_classifier")
5
 
6
  def predict_emotion(text):
7
- return pipe(text)[0]
8
-
9
  gr.Interface(
10
  fn=predict_emotion,
11
  inputs="text",
12
- outputs="label",
13
  title="Emotion Text Classifier"
14
  ).launch()
 
 
4
  pipe = pipeline("text-classification", model="michellejieli/emotion_text_classifier")
5
 
6
  def predict_emotion(text):
7
+ result = pipe(text)[0]
8
+ return result["label"]
9
  gr.Interface(
10
  fn=predict_emotion,
11
  inputs="text",
12
+ outputs="text",
13
  title="Emotion Text Classifier"
14
  ).launch()
15
+