import streamlit as st | |
from transformers import pipeline | |
st.title("SentimentSense") | |
st.write("Analyze the sentiment of customer feedback instantly.") | |
feedback = st.text_area("Enter customer feedback here:") | |
if st.button("Analyze Sentiment"): | |
sentiment_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english") | |
result = sentiment_pipeline(feedback) | |
label = result[0]['label'] | |
score = result[0]['score'] | |
st.write(f"Sentiment: {label} (Confidence: {score:.2f})") | |