Python, Data Science, AI, NLP, Programming.
sentiment_model = pipeline("sentiment-analysis") def predict(text): return sentiment_model(text)[0]["label"] iface = gr.Interface(fn=predict, inputs="text", outputs="text") iface.launch() That’s it! Just define your prediction function, specify the input and output types, and call launch() . Gradio