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)