# vijay-1420/spam-message-detector architecture

> Architecture diagram of the GitHub repository vijay-1420/spam-message-detector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vijay-1420/spam-message-detector
- Repository: https://github.com/vijay-1420/spam-message-detector

## Overview

This is a Streamlit spam-message classifier. A user enters text and clicks Predict; the app transforms the message with a saved vectorizer, classifies it with a saved model, and displays Spam or Not Spam. The README also describes NLP processing and reports 98% accuracy, but the sampled runtime code does not show how that accuracy was measured or how the artifacts were trained.

Main entry points: [`app.py`](https://github.com/vijay-1420/spam-message-detector/blob/main/app.py) (Streamlit app), [`vectorizer.pkl`](https://github.com/vijay-1420/spam-message-detector/blob/main/vectorizer.pkl) (Text vectorizer), [`spam_model.pkl`](https://github.com/vijay-1420/spam-message-detector/blob/main/spam_model.pkl) (Spam model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_input["Message input<br/>[app.py]"]
  node_result["Classification result<br/>[app.py]"]
end

subgraph group_inference["Message inference"]
  node_vectorizer["Text vectorizer<br/>[vectorizer.pkl]"]
  node_model["Spam model<br/>[spam_model.pkl]"]
end

node_user(("User"))

node_user -->|"enters message"| node_input
node_user -->|"clicks Predict"| node_app
node_app -->|"loads artifact"| node_vectorizer
node_app -->|"loads artifact"| node_model
node_app -->|"transforms text"| node_vectorizer
node_app -->|"predicts class"| node_model
node_app -->|"displays result"| node_result
node_result -->|"shows classification"| node_user

click node_app "https://github.com/vijay-1420/spam-message-detector/blob/main/app.py"
click node_input "https://github.com/vijay-1420/spam-message-detector/blob/main/app.py"
click node_vectorizer "https://github.com/vijay-1420/spam-message-detector/blob/main/vectorizer.pkl"
click node_model "https://github.com/vijay-1420/spam-message-detector/blob/main/spam_model.pkl"
click node_result "https://github.com/vijay-1420/spam-message-detector/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_app,node_input,node_result,node_user toneBlue
class node_vectorizer,node_model toneAmber
```

## Components

### Web interface

- [Streamlit app](https://github.com/vijay-1420/spam-message-detector/blob/main/app.py): `app.py`
- [Message input](https://github.com/vijay-1420/spam-message-detector/blob/main/app.py): `app.py`
- [Classification result](https://github.com/vijay-1420/spam-message-detector/blob/main/app.py): `app.py`

### Message inference

- [Text vectorizer](https://github.com/vijay-1420/spam-message-detector/blob/main/vectorizer.pkl): `vectorizer.pkl`
- [Spam model](https://github.com/vijay-1420/spam-message-detector/blob/main/spam_model.pkl): `spam_model.pkl`

### Other components

- **User**

## Connections

- User → Message input: enters message
- User → Streamlit app: clicks Predict
- Streamlit app → Text vectorizer: loads artifact
- Streamlit app → Spam model: loads artifact
- Streamlit app → Text vectorizer: transforms text
- Streamlit app → Spam model: predicts class
- Streamlit app → Classification result: displays result
- Classification result → User: shows classification
