How atharvtrivedi21/sentiment-analysis-dashboard works
Project Type and Purpose
• This is an interactive analytical dashboard (a single‐page Streamlit web app) for performing sentiment analysis on customer feedback.
• It ingests a text dataset, classifies sentiment via NLTK, and renders visualizations (bar chart, pie chart, word cloud).
File Structure
• Top‐level files:
• app.py – the Streamlit entry point and orchestrator
• batch_sentiment_data.csv – sample data source
• test.py – (optional) script for basic unit tests or dry‐run
• requirements.txt – Python dependencies
• No separate frontend/backend directories – the UI and logic live together in app.py.
• No external microservices; everything runs in one process.
README Insights
• Tech stack: Streamlit (UI), NLTK (NLP), Matplotlib/WordCloud (visuals), pandas (data handling).
• Key features listed: sentiment classification, distribution plots, word clouds.
• Deployment: runs via streamlit run app.py.
Main Components
a. User Interface (Streamlit Frontend)
• Handles user interactions (file upload or built-in dataset selection)
• Triggers analysis and renders charts
b. Data Layer
• CSV data input (batch_sentiment_data.csv) or dynamic input
• pandas DataFrame for in‐memory processing
c. Processing Layer
• NLTK Sentiment Analyzer
• Preprocessing: tokenization, stop‐word removal
• Classification: Positive/Neutral/Negative
d. Visualization Layer
• Matplotlib/Pyplot for bar and pie charts
• WordCloud library for generating word clouds
e. Optional Test Harness
• test.py script for sanity checks on the analysis functions
Relationships and Interactions
• User→Streamlit UI: selects data or uploads file
• UI→Data Layer: passes file path/data
• Data Layer→Processing Layer: provides raw text for NLP
• Processing Layer→Visualization Layer: returns sentiment counts and word frequencies
• Visualization Layer→UI: renders graphs and word clouds
Architectural Patterns and Design Principles
• Single‐process, event‐driven: Streamlit callbacks drive the workflow.
• Layered: clear separation of data, processing, and visualization within one script.
• Modularity: if scaling up, you could extract each layer into modules (e.g., data.py, nlp.py, viz.py).
Technologies and Libraries to Annotate
• Streamlit: UI framework
• pandas: data ingestion/manipulation
• NLTK: NLP preprocessing & sentiment classification
• Matplotlib & WordCloud: plotting & word cloud generation
• Python 3.x runtime