Ajeet001's picture
Update app.py
57d1846 verified
Raw History Blame Contribute Delete
383 Bytes
# 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)