# poojaanbalagan/sentimental-analysis architecture

> Architecture diagram of the GitHub repository poojaanbalagan/sentimental-analysis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/poojaanbalagan/sentimental-analysis
- Repository: https://github.com/poojaanbalagan/sentimental-analysis

## Overview

This repository combines a research/evaluation pipeline for three-class McDonald’s review sentiment with a web platform for exploring reviews, running predictions, and viewing analytics and model benchmarks. The user workflow runs from entering a review or uploading a batch in the frontend, through its API client to the backend, to sentiment results; dashboard views also retrieve metrics, reviews, and model information. The evaluation pipeline separately prepares data, builds features, benchmarks models, and produces diagnostics. Backend request handling is not excerpted, so its frontend connection is shown as unverified.

Main entry points: [`frontend/src/App.jsx`](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/App.jsx) (App shell), [`run_evaluation_pipeline.py`](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/run_evaluation_pipeline.py) (Evaluation orchestrator), [`frontend/src/services/api.js`](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/services/api.js) (API client), [`frontend/src/components/FilterBar.jsx`](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/FilterBar.jsx) (Filter controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App shell<br/>[App.jsx]"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_predictor["Live predictor<br/>[PredictorView.jsx]"]
  node_batch["Batch upload"]
  node_overview["Overview<br/>[OverviewView.jsx]"]
  node_analytics["Analytics<br/>[AnalyticsView.jsx]"]
  node_explorer["Review explorer<br/>[ExplorerView.jsx]"]
  node_performance["Model performance"]
  node_reports["Reports<br/>[ReportsView.jsx]"]
  node_filter["Filter controls<br/>[FilterBar.jsx]"]
  node_kpis["KPI cards<br/>[KpiCards.jsx]"]
  node_sidebar["Navigation<br/>[Sidebar.jsx]"]
end

subgraph group_api["Prediction API"]
  node_api_client["API client<br/>[api.js]"]
  node_server["Backend API<br/>[server.py]"]
end

subgraph group_research["Research pipeline"]
  node_pipeline["Evaluation orchestrator"]
  node_loader["Data loading<br/>[data_loader.py]"]
end

subgraph group_ml["Modeling"]
  node_features["Text features"]
  node_models["Sentiment models<br/>[models.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_metrics["Evaluation metrics"]
  node_crossval["Cross-validation"]
  node_robustness["Robustness tests"]
  node_errors["Error analysis<br/>[error_analysis.py]"]
  node_ablation["Ablation studies"]
  node_explain["Explainability<br/>[explainability.py]"]
  node_efficiency["Efficiency tests<br/>[efficiency.py]"]
end

node_user(("Analyst"))

node_user -->|"uses"| node_app
node_app -->|"provides theme"| node_theme
node_app -->|"renders"| node_sidebar
node_app -->|"routes to"| node_predictor
node_app -->|"routes to"| node_batch
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_explorer
node_app -->|"routes to"| node_performance
node_app -->|"routes to"| node_reports
node_app -->|"fetches initial data"| node_api_client
node_overview -->|"renders"| node_kpis
node_overview -->|"renders"| node_filter
node_analytics -->|"renders"| node_filter
node_explorer -->|"renders"| node_filter
node_reports -->|"renders"| node_filter
node_predictor -->|"requests predictions"| node_api_client
node_batch -->|"uploads batch"| node_api_client
node_analytics -->|"requests analytics"| node_api_client
node_explorer -->|"requests reviews"| node_api_client
node_performance -->|"requests models"| node_api_client
node_reports -->|"requests report data"| node_api_client
node_api_client -.->|"calls REST endpoints"| node_server
node_server -->|"uses models"| node_models
node_pipeline -->|"loads data"| node_loader
node_pipeline -->|"builds features"| node_features
node_pipeline -->|"trains models"| node_models
node_pipeline -->|"computes metrics"| node_metrics
node_pipeline -->|"runs validation"| node_crossval
node_pipeline -->|"tests robustness"| node_robustness
node_pipeline -->|"analyzes errors"| node_errors
node_pipeline -->|"runs ablations"| node_ablation
node_pipeline -->|"extracts features"| node_explain
node_pipeline -->|"measures efficiency"| node_efficiency
node_crossval -->|"uses"| node_features
node_crossval -->|"uses"| node_models
node_ablation -->|"uses"| node_features
node_ablation -->|"uses"| node_models

click node_app "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/App.jsx"
click node_theme "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/context/ThemeContext.jsx"
click node_predictor "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/PredictorView.jsx"
click node_batch "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/BatchUploadView.jsx"
click node_overview "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/OverviewView.jsx"
click node_analytics "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/AnalyticsView.jsx"
click node_explorer "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ExplorerView.jsx"
click node_performance "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ModelPerformanceView.jsx"
click node_reports "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ReportsView.jsx"
click node_filter "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/FilterBar.jsx"
click node_kpis "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/KpiCards.jsx"
click node_sidebar "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/Sidebar.jsx"
click node_api_client "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/server.py"
click node_pipeline "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/run_evaluation_pipeline.py"
click node_loader "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/data_loader.py"
click node_features "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/feature_engineering.py"
click node_models "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/models.py"
click node_metrics "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/evaluation_metrics.py"
click node_crossval "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/cross_validation.py"
click node_robustness "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/robustness_testing.py"
click node_errors "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/error_analysis.py"
click node_ablation "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/ablation_studies.py"
click node_explain "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/explainability.py"
click node_efficiency "https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/efficiency.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_theme,node_predictor,node_batch,node_overview,node_analytics,node_explorer,node_performance,node_reports,node_filter,node_kpis,node_sidebar toneBlue
class node_api_client,node_server toneAmber
class node_pipeline,node_loader toneMint
class node_features,node_models toneRose
class node_metrics,node_crossval,node_robustness,node_errors,node_ablation,node_explain,node_efficiency,node_user toneIndigo
```

## Components

### Web application

- [App shell](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Theme state](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/context/ThemeContext.jsx): `frontend/src/context/ThemeContext.jsx`
- [Live predictor](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/PredictorView.jsx): `frontend/src/views/PredictorView.jsx`
- [Batch upload](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/BatchUploadView.jsx): `frontend/src/views/BatchUploadView.jsx`
- [Overview](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/OverviewView.jsx): `frontend/src/views/OverviewView.jsx`
- [Analytics](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/AnalyticsView.jsx): `frontend/src/views/AnalyticsView.jsx`
- [Review explorer](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ExplorerView.jsx): `frontend/src/views/ExplorerView.jsx`
- [Model performance](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ModelPerformanceView.jsx): `frontend/src/views/ModelPerformanceView.jsx`
- [Reports](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/views/ReportsView.jsx): `frontend/src/views/ReportsView.jsx`
- [Filter controls](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/FilterBar.jsx): `frontend/src/components/FilterBar.jsx`
- [KPI cards](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/KpiCards.jsx): `frontend/src/components/KpiCards.jsx`
- [Navigation](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`

### Prediction API

- [API client](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Backend API](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/server.py): `server.py`

### Research pipeline

- [Evaluation orchestrator](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/run_evaluation_pipeline.py): `run_evaluation_pipeline.py`
- [Data loading](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/data_loader.py): `src/data_loader.py`

### Modeling

- [Text features](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/feature_engineering.py): `src/feature_engineering.py`
- [Sentiment models](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/models.py): `src/models.py`

### Evaluation

- [Evaluation metrics](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/evaluation_metrics.py): `src/evaluation_metrics.py`
- [Cross-validation](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/cross_validation.py): `src/cross_validation.py`
- [Robustness tests](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/robustness_testing.py): `src/robustness_testing.py`
- [Error analysis](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/error_analysis.py): `src/error_analysis.py`
- [Ablation studies](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/ablation_studies.py): `src/ablation_studies.py`
- [Explainability](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/explainability.py): `src/explainability.py`
- [Efficiency tests](https://github.com/poojaanbalagan/sentimental-analysis/blob/main/src/efficiency.py): `src/efficiency.py`

### Other components

- **Analyst**

## Connections

- Analyst → App shell: uses (evidence: `README.md`)
- App shell → Theme state: provides theme (evidence: `frontend/src/App.jsx`)
- App shell → Navigation: renders (evidence: `frontend/src/App.jsx`)
- App shell → Live predictor: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Batch upload: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Overview: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Analytics: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Review explorer: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Model performance: routes to (evidence: `frontend/src/App.jsx`)
- App shell → Reports: routes to (evidence: `frontend/src/App.jsx`)
- App shell → API client: fetches initial data (evidence: `frontend/src/App.jsx`)
- Overview → KPI cards: renders (evidence: `frontend/src/views/OverviewView.jsx`)
- Overview → Filter controls: renders (evidence: `frontend/src/views/OverviewView.jsx`)
- Analytics → Filter controls: renders (evidence: `frontend/src/views/AnalyticsView.jsx`)
- Review explorer → Filter controls: renders (evidence: `frontend/src/views/ExplorerView.jsx`)
- Reports → Filter controls: renders (evidence: `frontend/src/views/ReportsView.jsx`)
- Live predictor → API client: requests predictions (evidence: `frontend/src/views/PredictorView.jsx`)
- Batch upload → API client: uploads batch (evidence: `frontend/src/views/BatchUploadView.jsx`)
- Analytics → API client: requests analytics (evidence: `frontend/src/views/AnalyticsView.jsx`)
- Review explorer → API client: requests reviews (evidence: `frontend/src/views/ExplorerView.jsx`)
- Model performance → API client: requests models (evidence: `frontend/src/views/ModelPerformanceView.jsx`)
- Reports → API client: requests report data (evidence: `frontend/src/views/ReportsView.jsx`)
- API client → Backend API: calls REST endpoints
- Backend API → Sentiment models: uses models (evidence: `server.py`)
- Evaluation orchestrator → Data loading: loads data (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Text features: builds features (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Sentiment models: trains models (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Evaluation metrics: computes metrics (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Cross-validation: runs validation (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Robustness tests: tests robustness (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Error analysis: analyzes errors (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Ablation studies: runs ablations (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Explainability: extracts features (evidence: `run_evaluation_pipeline.py`)
- Evaluation orchestrator → Efficiency tests: measures efficiency (evidence: `run_evaluation_pipeline.py`)
- Cross-validation → Text features: uses (evidence: `src/cross_validation.py`)
- Cross-validation → Sentiment models: uses (evidence: `src/cross_validation.py`)
- Ablation studies → Text features: uses (evidence: `src/ablation_studies.py`)
- Ablation studies → Sentiment models: uses (evidence: `src/ablation_studies.py`)
