A Streamlit-based Sentiment Analysis Dashboard that analyzes text data from CSV files, classifies sentiment as Positive, Neutral, or Negative, and visualizes results using interactive charts.
Users can upload datasets, filter by sentiment, and download processed results for further analysis.
This dashboard allows users to:
- 📂 Upload CSV files containing text data
- 🧹 Automatically clean and preprocess text
- 😊 Classify sentiment using NLP
- 📊 Visualize sentiment distribution (Bar, Pie, Line charts)
- 🔍 Filter rows by sentiment
- 📥 Download filtered results
The application is built using Streamlit, TextBlob, and Matplotlib.
- Detects all text (object-type) columns
- Merges multiple text columns into a single analyzable field
- Converts text to lowercase
- Removes URLs, mentions, hashtags
- Removes punctuation and numbers
- Eliminates extra whitespace
- Uses TextBlob polarity score
- Classifies as:
- Positive (polarity > 0)
- Neutral (polarity = 0)
- Negative (polarity < 0)
- Summary metrics (Total, Positive, Neutral, Negative)
- Bar chart visualization
- Pie chart distribution
- Line graph (Sentiment Count)
- Sentiment filtering
- CSV download option
- Python
- Streamlit
- Pandas
- TextBlob
- Matplotlib
- Regex (re)
sentiment_dashboard/ │ ├── app.py # Main Streamlit application ├── requirements.txt # Project dependencies └── README.md
git clone <your-repository-link>
cd sentiment_dashboard
2️⃣ Install Dependencies
pip install -r requirements.txt
3️⃣ Run the Application
streamlit run app.py
The dashboard will open in your browser at:
http://localhost:8501
📊 How It Works
Upload a CSV file containing text data.
The system:
Detects text columns
Cleans and preprocesses text
Computes sentiment polarity
Displays:
Summary metrics
Visual charts
Filtered data view
Download processed dataset if needed.
Example Visualizations
Sentiment Distribution (Bar Chart)
Sentiment Percentage (Pie Chart)
Sentiment Count (Line Graph)
Key Learning Outcomes
Text preprocessing using regex
Sentiment analysis using TextBlob
Data manipulation with Pandas
Interactive dashboard development using Streamlit
Data visualization using Matplotlib
CSV file handling and dynamic filtering
🚀 Future Enhancements
Add VADER sentiment model for comparison
Support real-time Twitter/YouTube comment analysis
Add word cloud visualization
Deploy on Streamlit Cloud or AWS
Add authentication and user-based uploads