How abhisheknishad23/sentiment-analysis works
This Flask dashboard accepts either a CSV of reviews or one review, cleans the text, applies the saved TF-IDF vectorizer and sentiment model, then renders predictions. Batch analysis also reports sentiment counts and percentages and produces a pie chart; individual analysis returns a single Positive/Negative result. The README documents these capabilities, while the sampled backend shows the route-level calls and model loading. The template and stylesheet are represented from the tree and README; their internal wiring was not sampled.
Main entry points: main.py CSV analysis route · index.html Dashboard UI · tfidf_vectorizer.pkl TF-IDF vectorizer · sentiment_model.pkl Sentiment model
Components 12
Web interface
- Flask app
main.py - Dashboard UI
templates/index.html - Dashboard styling
static/style.css
Analysis workflows
- CSV analysis route
main.py - Single review route
main.py - Uploaded CSV
Sentiment engine
- Text cleaning
main.py - TF-IDF vectorizer
tfidf_vectorizer.pkl - Sentiment model
sentiment_model.pkl
Batch analytics
- Sentiment metrics
main.py - Pie chart
main.py
Other components
- Dashboard user
Connections 20
- Dashboard user → Dashboard UI: uses
README.md - Dashboard user → CSV analysis route: uploads CSV
README.md - Dashboard user → Single review route: submits review
README.md - Flask app → Dashboard UI: renders
main.py - Dashboard UI → Dashboard styling: styled by
- Flask app → CSV analysis route: routes request
main.py - Flask app → Single review route: routes request
main.py - Uploaded CSV → CSV analysis route: supplies rows
main.py - CSV analysis route → Text cleaning: cleans reviews
main.py - CSV analysis route → TF-IDF vectorizer: vectorizes text
main.py - CSV analysis route → Sentiment model: predicts labels
main.py - CSV analysis route → Sentiment metrics: counts labels
main.py - CSV analysis route → Pie chart: generates chart
main.py - CSV analysis route → Dashboard UI: renders results
main.py - Single review route → Text cleaning: cleans review
main.py - Single review route → TF-IDF vectorizer: vectorizes text
main.py - Single review route → Sentiment model: predicts label
main.py - Single review route → Dashboard UI: renders result
main.py - Flask app → Sentiment model: loads model
main.py - Flask app → TF-IDF vectorizer: loads vectorizer
main.py