import gradio as gr from transformers import pipeline # Load sentiment model classifier = pipeline("sentiment-analysis") def analyze_sentiment(text): result = classifier(text) return result[0] interface = gr.Interface( fn=analyze_sentiment, inputs="text", outputs="label", title="Sentiment Analysis App", description="Analyze sentiment using Hugging Face model" ) interface.launch()