import gradio as gr from transformers import pipeline sentiment = pipeline("sentiment-analysis") def get_sentiment(text): return sentiment(text)[0]["label"] demo = gr.Interface( fn=get_sentiment, inputs="text", outputs=["text"], title="Sentiment Analysis", description="Enter some text here we will analyse the sentiment" ) demo.launch(inline=False)