Spaces:
Build error
Build error
Download app.py from MagicMeWizard/Sentiment_analysis_expert: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/spaces/MagicMeWizard/Sentiment_analysis_expert/resolve/main/app.py
- Command line
-
hf download hf://spaces/MagicMeWizard/Sentiment_analysis_expert/app.py
-
curl -L -o app.py https://huggingface.co/spaces/MagicMeWizard/Sentiment_analysis_expert/resolve/main/app.py
524 Bytes
| 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})") | |