# Filename: sentiment_app.py import gradio as gr from transformers import pipeline classifier = pipeline("sentiment-analysis") def analyze_sentiment(text): return classifier(text)[0]['label'] gr.Interface( fn=analyze_sentiment, inputs=gr.Textbox(label="Enter Text"), outputs=gr.Textbox(label="Sentiment"), title="📝 Sentiment Analyzer" ).launch(share=True)