import gradio as gr from transformers import pipeline sentiment = pipeline("sentiment-analysis") def sent(input_text): return sentiment(input_text) iface = gr.Interface(fn = sent, inputs = 'text' , outputs = ['text'], title = 'sentiment analysis', description = 'this is taking the sentiment of a sentence') iface.launch()