# irtazahussain11223/smart-spam-email-sms-classifier architecture

> Architecture diagram of the GitHub repository irtazahussain11223/smart-spam-email-sms-classifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/irtazahussain11223/smart-spam-email-sms-classifier
- Repository: https://github.com/irtazahussain11223/smart-spam-email-sms-classifier

## Overview

This is a small Streamlit spam-classification app. A user selects SMS or email, enters text, and submits it; the app transforms that text with the saved TF-IDF vectorizer, predicts with the saved Logistic Regression model, and displays Spam or Ham. The source shows these runtime calls, but does not expose separate preprocessing code or the model-training workflow.

Main entry points: [`app.py`](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py) (Streamlit app), [`vectorizer.pkl`](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/vectorizer.pkl) (TF-IDF vectorizer), [`model.pkl`](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/model.pkl) (Logistic Regression)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_app["Streamlit app<br/>[app.py]"]
node_sms["SMS input<br/>[app.py]"]
node_email["Email input<br/>[app.py]"]
node_vectorizer["TF-IDF vectorizer<br/>[vectorizer.pkl]"]
node_model["Logistic Regression<br/>[model.pkl]"]
node_result["Spam/Ham result<br/>[app.py]"]

node_user -->|"uses"| node_app
node_app -->|"offers"| node_sms
node_app -->|"offers"| node_email
node_sms -->|"submits text"| node_app
node_email -->|"submits text"| node_app
node_app -->|"loads and transforms"| node_vectorizer
node_app -->|"loads and predicts"| node_model
node_app -->|"displays label"| node_result
node_result -->|"shows result"| node_user

click node_app "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py"
click node_sms "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py"
click node_email "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py"
click node_vectorizer "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/vectorizer.pkl"
click node_model "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/model.pkl"
click node_result "https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/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_user toneBlue
class node_app,node_sms,node_email,node_vectorizer,node_model,node_result toneTeal
```

## Components

### Other components

- **User**
- [Streamlit app](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py): `app.py`
- [SMS input](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py): `app.py`
- [Email input](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py): `app.py`
- [TF-IDF vectorizer](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/vectorizer.pkl): `vectorizer.pkl`
- [Logistic Regression](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/model.pkl): `model.pkl`
- [Spam/Ham result](https://github.com/irtazahussain11223/smart-spam-email-sms-classifier/blob/main/app.py): `app.py`

## Connections

- User → Streamlit app: uses
- Streamlit app → SMS input: offers
- Streamlit app → Email input: offers
- SMS input → Streamlit app: submits text
- Email input → Streamlit app: submits text
- Streamlit app → TF-IDF vectorizer: loads and transforms
- Streamlit app → Logistic Regression: loads and predicts
- Streamlit app → Spam/Ham result: displays label
- Spam/Ham result → User: shows result
