Downloads · 30 days
0
triveen/sentiment-analysis-model
sentiment-analysis-model is a machine learning model from triveen. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
from transformers import pipeline import gradio as gr
Downloads · 30 days
0
Access
Public
Updated Jun 20, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
Other1.5 KB · 75%
From the Hugging Face model README
from transformers import pipeline import gradio as gr
classifier = pipeline( "sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english" )
def predict_sentiment(text): result = classifier(text)
label = result[0]["label"]
score = result[0]["score"]
return f"{label} ({score:.2f})"
app = gr.Interface( fn=predict_sentiment, inputs="text", outputs="text", title="Sentiment Analysis using Hugging Face" )
app.launch()