# rohan271004/sms_spam_detection architecture

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

- Interactive diagram: https://gitdiagram.com/rohan271004/sms_spam_detection
- Repository: https://github.com/rohan271004/sms_spam_detection

## Overview

This repository is an SMS spam-classification product: a user enters a message in the Streamlit app and receives a spam/not-spam result. The app preprocesses text, transforms it with the serialized vectorizer, and classifies it with the pretrained model. The README also describes a notebook for training and evaluation and a dataset for training/testing; their internal workflow is not shown in the sampled source, so that branch is limited to documented relationships.

Main entry points: [`app.py`](https://github.com/rohan271004/sms_spam_detection/blob/main/app.py) (Streamlit interface), [`vectorizer.pkl`](https://github.com/rohan271004/sms_spam_detection/blob/main/vectorizer.pkl) (Text vectorizer), [`model.pkl`](https://github.com/rohan271004/sms_spam_detection/blob/main/model.pkl) (Spam classifier), [`SMS_SPAM_DETECTION.ipynb`](https://github.com/rohan271004/sms_spam_detection/blob/main/SMS_SPAM_DETECTION.ipynb) (Training and evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_streamlit_app["Streamlit interface<br/>[app.py]"]
end

subgraph group_classification["Message classification"]
  node_preprocessing["Text preprocessing<br/>[app.py]"]
  node_vectorizer["Text vectorizer<br/>[vectorizer.pkl]"]
  node_classifier["Spam classifier<br/>[model.pkl]"]
end

subgraph group_training["Training data"]
  node_training_notebook["Training and evaluation"]
  node_sms_dataset[("SMS dataset")]
end

node_user(("Message sender"))

node_user -->|"enters SMS"| node_streamlit_app
node_streamlit_app -->|"preprocesses text"| node_preprocessing
node_preprocessing -->|"transforms text"| node_vectorizer
node_streamlit_app -->|"loads artifact"| node_vectorizer
node_streamlit_app -->|"loads artifact"| node_classifier
node_streamlit_app -->|"predicts class"| node_classifier
node_training_notebook -->|"uses for training"| node_sms_dataset

click node_streamlit_app "https://github.com/rohan271004/sms_spam_detection/blob/main/app.py"
click node_preprocessing "https://github.com/rohan271004/sms_spam_detection/blob/main/app.py"
click node_vectorizer "https://github.com/rohan271004/sms_spam_detection/blob/main/vectorizer.pkl"
click node_classifier "https://github.com/rohan271004/sms_spam_detection/blob/main/model.pkl"
click node_training_notebook "https://github.com/rohan271004/sms_spam_detection/blob/main/SMS_SPAM_DETECTION.ipynb"
click node_sms_dataset "https://github.com/rohan271004/sms_spam_detection/blob/main/sms-spam-detection.csv"

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_streamlit_app toneBlue
class node_preprocessing,node_vectorizer,node_classifier toneAmber
class node_training_notebook,node_sms_dataset toneMint
class node_user toneIndigo
```

## Components

### User interaction

- [Streamlit interface](https://github.com/rohan271004/sms_spam_detection/blob/main/app.py): `app.py`

### Message classification

- [Text preprocessing](https://github.com/rohan271004/sms_spam_detection/blob/main/app.py): `app.py`
- [Text vectorizer](https://github.com/rohan271004/sms_spam_detection/blob/main/vectorizer.pkl): `vectorizer.pkl`
- [Spam classifier](https://github.com/rohan271004/sms_spam_detection/blob/main/model.pkl): `model.pkl`

### Training data

- [Training and evaluation](https://github.com/rohan271004/sms_spam_detection/blob/main/SMS_SPAM_DETECTION.ipynb): `SMS_SPAM_DETECTION.ipynb`
- [SMS dataset](https://github.com/rohan271004/sms_spam_detection/blob/main/sms-spam-detection.csv): `sms-spam-detection.csv`

### Other components

- **Message sender**

## Connections

- Message sender → Streamlit interface: enters SMS (evidence: `README.md`)
- Streamlit interface → Text preprocessing: preprocesses text (evidence: `app.py`)
- Text preprocessing → Text vectorizer: transforms text (evidence: `app.py`)
- Streamlit interface → Text vectorizer: loads artifact (evidence: `app.py`)
- Streamlit interface → Spam classifier: loads artifact (evidence: `app.py`)
- Streamlit interface → Spam classifier: predicts class (evidence: `app.py`)
- Training and evaluation → SMS dataset: uses for training (evidence: `README.md`)
