File size: 524 Bytes
0b8a2f5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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})")
|