Spaces:
Runtime error
Runtime error
changing the model, input examples and label
Browse files
app.py
CHANGED
|
@@ -2,19 +2,19 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
def generate_story(story):
|
| 5 |
-
ner = pipeline("
|
| 6 |
return str(ner(story))
|
| 7 |
|
| 8 |
demo = gr.Interface (
|
| 9 |
fn=generate_story,
|
| 10 |
-
description="
|
| 11 |
examples=[
|
| 12 |
-
["
|
| 13 |
-
["
|
| 14 |
-
["
|
| 15 |
],
|
| 16 |
inputs=[gr.Textbox(lines=7, label="Text")],
|
| 17 |
-
outputs=[gr.Textbox(lines=7, label="
|
| 18 |
)
|
| 19 |
|
| 20 |
demo.launch(share=True)
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
def generate_story(story):
|
| 5 |
+
ner = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions")
|
| 6 |
return str(ner(story))
|
| 7 |
|
| 8 |
demo = gr.Interface (
|
| 9 |
fn=generate_story,
|
| 10 |
+
description="Sentiment analysis multi-class with (SamLowe/roberta-base-go_emotions",
|
| 11 |
examples=[
|
| 12 |
+
["I am looking forward to a good maths session."],
|
| 13 |
+
["Good that they broke up, not like it was going anywhere anyways."],
|
| 14 |
+
["I am going to punch through his face next time he mentions notes!"]
|
| 15 |
],
|
| 16 |
inputs=[gr.Textbox(lines=7, label="Text")],
|
| 17 |
+
outputs=[gr.Textbox(lines=7, label="Multiclass Sentiment Analysis")]
|
| 18 |
)
|
| 19 |
|
| 20 |
demo.launch(share=True)
|