MagicMeWizard commited on
Commit
0b8a2f5
1 Parent(s): 651a216

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ st.title("SentimentSense")
5
+ st.write("Analyze the sentiment of customer feedback instantly.")
6
+
7
+ feedback = st.text_area("Enter customer feedback here:")
8
+
9
+ if st.button("Analyze Sentiment"):
10
+ sentiment_pipeline = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
11
+ result = sentiment_pipeline(feedback)
12
+ label = result[0]['label']
13
+ score = result[0]['score']
14
+ st.write(f"Sentiment: {label} (Confidence: {score:.2f})")