# dineshkarthik8555/customer-feedback-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/dineshkarthik8555/customer-feedback-analysis
- Repository: https://github.com/dineshkarthik8555/customer-feedback-analysis

## Overview

This is a Streamlit customer-feedback analysis product. Users enter a review or upload a CSV; the dashboard validates and cleans feedback, predicts sentiment, and presents predictions and analytics, including rule-based complaint categories. A separate training workflow compares classifiers, evaluates them, and saves the selected model and reports. The README documents six dashboard capabilities; the sampled app excerpts show live prediction and analytics details, but not every page implementation. Edges reflect shown calls or documented behavior; unsampled page wiring is not inferred.

Main entry points: [`app.py`](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/app.py) (Dashboard pages), [`src/train.py`](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/train.py) (Training and selection), [`src/preprocessing.py`](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/preprocessing.py) (Validation and cleaning), [`src/predict.py`](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/predict.py) (Sentiment prediction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_dashboard["Dashboard pages<br/>[app.py]"]
  node_ui["UI styling<br/>[ui.py]"]
end

subgraph group_analysis["Feedback analysis"]
  node_preprocessing["Validation and cleaning<br/>[preprocessing.py]"]
  node_prediction["Sentiment prediction<br/>[predict.py]"]
  node_complaints["Complaint analysis<br/>[complaints.py]"]
end

subgraph group_modeling["Model training"]
  node_training["Training and selection<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_sample_data["Sample reviews"]
  node_model_file[("Saved model")]
  node_results[("Evaluation reports")]
end

node_user(("Business user"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"renders with"| node_ui
node_dashboard -->|"requests predictions"| node_prediction
node_dashboard -->|"requests categories"| node_complaints
node_dashboard -->|"validates uploads"| node_preprocessing
node_dashboard -.->|"retraining fallback"| node_training
node_prediction -->|"cleans text"| node_preprocessing
node_complaints -->|"cleans text"| node_preprocessing
node_training -->|"prepares data"| node_preprocessing
node_training -->|"computes metrics"| node_evaluation
node_training -->|"uses fallback data"| node_sample_data
node_training -->|"saves selected model"| node_model_file
node_training -->|"writes reports"| node_results
node_dashboard -->|"loads model"| node_model_file

click node_dashboard "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/app.py"
click node_ui "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/ui.py"
click node_preprocessing "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/preprocessing.py"
click node_prediction "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/predict.py"
click node_complaints "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/complaints.py"
click node_training "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/train.py"
click node_evaluation "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/evaluate.py"
click node_sample_data "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/data/sample_feedback.csv"
click node_model_file "https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/models/sentiment_model.pkl"
click node_results "https://github.com/dineshkarthik8555/customer-feedback-analysis/tree/main/results"

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_dashboard,node_ui,node_user toneBlue
class node_preprocessing,node_prediction,node_complaints toneAmber
class node_training,node_evaluation toneMint
class node_sample_data,node_model_file,node_results toneRose
```

## Components

### Dashboard experience

- [Dashboard pages](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/app.py): `app.py`
- [UI styling](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/ui.py): `src/ui.py`

### Feedback analysis

- [Validation and cleaning](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/preprocessing.py): `src/preprocessing.py`
- [Sentiment prediction](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/predict.py): `src/predict.py`
- [Complaint analysis](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/complaints.py): `src/complaints.py`

### Model training

- [Training and selection](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/train.py): `src/train.py`
- [Model evaluation](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/src/evaluate.py): `src/evaluate.py`

### Data and artifacts

- [Sample reviews](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/data/sample_feedback.csv): `data/sample_feedback.csv`
- [Saved model](https://github.com/dineshkarthik8555/customer-feedback-analysis/blob/main/models/sentiment_model.pkl): `models/sentiment_model.pkl`
- [Evaluation reports](https://github.com/dineshkarthik8555/customer-feedback-analysis/tree/main/results): `results`

### Other components

- **Business user**

## Connections

- Business user → Dashboard pages: uses (evidence: `README.md`)
- Dashboard pages → UI styling: renders with (evidence: `app.py`)
- Dashboard pages → Sentiment prediction: requests predictions (evidence: `app.py`)
- Dashboard pages → Complaint analysis: requests categories (evidence: `app.py`)
- Dashboard pages → Validation and cleaning: validates uploads (evidence: `app.py`)
- Dashboard pages → Training and selection: retraining fallback (evidence: `README.md`)
- Sentiment prediction → Validation and cleaning: cleans text (evidence: `src/predict.py`)
- Complaint analysis → Validation and cleaning: cleans text (evidence: `src/complaints.py`)
- Training and selection → Validation and cleaning: prepares data (evidence: `src/train.py`)
- Training and selection → Model evaluation: computes metrics (evidence: `src/train.py`)
- Training and selection → Sample reviews: uses fallback data (evidence: `README.md`)
- Training and selection → Saved model: saves selected model (evidence: `src/train.py`)
- Training and selection → Evaluation reports: writes reports (evidence: `src/train.py`)
- Dashboard pages → Saved model: loads model (evidence: `README.md`)
