I2C-UHU commited on
Commit
4b791e9
1 Parent(s): f4a79fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,12 +15,12 @@ demo = gr.Interface(
15
  pipe = pipeline("sentiment-analysis", model="michellejieli/emotion_text_classifier")
16
 
17
  def predict(text):
18
- return pipe(text)[0]["label"]
19
 
20
  demo = gr.Interface(
21
- fn=predict,
22
- inputs='text',
23
- outputs='text',
24
  )
25
 
26
  demo.launch()
 
15
  pipe = pipeline("sentiment-analysis", model="michellejieli/emotion_text_classifier")
16
 
17
  def predict(text):
18
+ return pipe(text)[0]["label"], pipe(text)[0]['score']
19
 
20
  demo = gr.Interface(
21
+ fn = predict,
22
+ inputs = gr.Textbox(placeholder="Text here ..."),
23
+ outputs = ['text', 'number']
24
  )
25
 
26
  demo.launch()