Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
| 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()
|