# abhishek-cee/sms-spam-detection architecture

> Architecture diagram of the GitHub repository abhishek-cee/sms-spam-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhishek-cee/sms-spam-detection
- Repository: https://github.com/abhishek-cee/sms-spam-detection

## Overview

This is a Streamlit SMS spam-classification application. A user opens the dashboard, which loads and validates the labelled SMS dataset, splits it, and trains a CountVectorizer–Multinomial Naive Bayes pipeline. Users can enter a message for a prediction or inspect held-out evaluation metrics, a confusion matrix, and a downloadable classification report. The README documents these capabilities, and the sampled app excerpt supports the main data and model flow; some intervening implementation details were not shown.

Main entry points: [`app.py`](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py) (Load and validate), [`SMSSpamCollection`](https://github.com/abhishek-cee/sms-spam-detection/blob/main/SMSSpamCollection) (SMS dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset["SMS dataset"]
  node_loading["Load and validate<br/>[app.py]"]
end

subgraph group_model["Model workflow"]
  node_split["Train/test split<br/>[app.py]"]
  node_vectorizer["CountVectorizer<br/>[app.py]"]
  node_classifier["Naive Bayes<br/>[app.py]"]
end

subgraph group_app["Dashboard features"]
  node_dashboard["Dataset dashboard<br/>[app.py]"]
  node_detector["SMS detector<br/>[app.py]"]
  node_evaluation["Model evaluation<br/>[app.py]"]
  node_report["CSV report<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"selects view"| node_dashboard
node_dashboard -->|"loads data"| node_loading
node_loading -->|"reads"| node_dataset
node_loading -->|"prepares labels"| node_split
node_split -->|"trains pipeline"| node_vectorizer
node_vectorizer -->|"provides features"| node_classifier
node_user -->|"enters message"| node_detector
node_detector -->|"predicts"| node_classifier
node_user -->|"opens view"| node_evaluation
node_evaluation -->|"evaluates predictions"| node_classifier
node_evaluation -->|"exports"| node_report

click node_dataset "https://github.com/abhishek-cee/sms-spam-detection/blob/main/SMSSpamCollection"
click node_loading "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_split "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_vectorizer "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_classifier "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_dashboard "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_detector "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_evaluation "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py"
click node_report "https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.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_dataset,node_loading,node_user toneBlue
class node_split,node_vectorizer,node_classifier toneAmber
class node_dashboard,node_detector,node_evaluation,node_report toneMint
```

## Components

### Data preparation

- [SMS dataset](https://github.com/abhishek-cee/sms-spam-detection/blob/main/SMSSpamCollection): `SMSSpamCollection`
- [Load and validate](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`

### Model workflow

- [Train/test split](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`
- [CountVectorizer](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`
- [Naive Bayes](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`

### Dashboard features

- [Dataset dashboard](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`
- [SMS detector](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`
- [Model evaluation](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`
- [CSV report](https://github.com/abhishek-cee/sms-spam-detection/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Dataset dashboard: selects view (evidence: `app.py`)
- Dataset dashboard → Load and validate: loads data (evidence: `app.py`)
- Load and validate → SMS dataset: reads (evidence: `app.py`)
- Load and validate → Train/test split: prepares labels (evidence: `app.py`)
- Train/test split → CountVectorizer: trains pipeline (evidence: `app.py`)
- CountVectorizer → Naive Bayes: provides features (evidence: `app.py`)
- User → SMS detector: enters message (evidence: `app.py`)
- SMS detector → Naive Bayes: predicts (evidence: `app.py`)
- User → Model evaluation: opens view (evidence: `app.py`)
- Model evaluation → Naive Bayes: evaluates predictions (evidence: `app.py`)
- Model evaluation → CSV report: exports (evidence: `app.py`)
