Spaces:
Runtime error
Runtime error
File size: 712 Bytes
a970736 e91e0ec 5a65659 c805802 4c721f6 1fb95f7 5a65659 c805802 4c721f6 83c780e 4c721f6 83c780e 021f551 4c721f6 1cfb225 5a65659 619e8b5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from transformers import pipeline
def generate_story(story):
ner = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions")
return str(ner(story))
demo = gr.Interface (
fn=generate_story,
description="Sentiment analysis multi-class with (SamLowe/roberta-base-go_emotions",
examples=[
["I am looking forward to a good maths session."],
["Good that they broke up, not like it was going anywhere anyways."],
["I am going to punch through his face next time he mentions notes!"]
],
inputs=[gr.Textbox(lines=7, label="Text")],
outputs=[gr.Textbox(lines=7, label="Multiclass Sentiment Analysis")]
)
demo.launch(share=True) |