# tolgatopaloglu/turkish-sms-spam-detection architecture

> Architecture diagram of the GitHub repository tolgatopaloglu/turkish-sms-spam-detection, 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/tolgatopaloglu/turkish-sms-spam-detection
- Repository: https://github.com/tolgatopaloglu/turkish-sms-spam-detection

## Overview

This repository provides Turkish SMS spam classification: `main.py` loads a serialized model, predicts labels for sample messages, prints the results, and writes `test.csv`. The README also documents a separate model-development workflow using TF-IDF, model comparison and tuning, metric tracking, and model registration; the notebook and dataset are present, but their implementation was not sampled, so their internal wiring is shown only where documented. The trained artifact's internal pipeline is described by the README, not verified from source.

Main entry points: [`turkish_SMS_spam_classification.ipynb`](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb) (Training workflow), [`main.py`](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py) (Prediction script), [`SMS_Spam_Classifcation.pkl`](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl) (Trained model), [`test.csv`](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/test.csv) (CSV results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["SMS inference"]
  node_entry["Prediction script<br/>[main.py]"]
  node_messages["Sample messages<br/>[main.py]"]
  node_model["Trained model"]
  node_vectorizer["TF-IDF features"]
  node_classifier["Tuned LinearSVC"]
  node_labels["Spam / Normal<br/>[main.py]"]
  node_results["Result table<br/>[main.py]"]
end

subgraph group_development["Model development"]
  node_notebook["Training workflow"]
  node_experiments["Model comparison"]
  node_tuning["Hyperparameter tuning"]
  node_metrics["Evaluation metrics"]
  node_registry["Model registry"]
end

subgraph group_data["Data and artifacts"]
  node_csv["CSV results<br/>[test.csv]"]
  node_dataset["SMS dataset"]
end

node_user(("Project runner"))
node_mlflow[("MLflow")]

node_user -->|"runs"| node_entry
node_entry -->|"loads"| node_model
node_entry -->|"predicts on"| node_messages
node_entry -->|"calls predict"| node_model
node_model -->|"transforms with"| node_vectorizer
node_vectorizer -->|"provides features"| node_classifier
node_classifier -->|"classifies as"| node_labels
node_entry -->|"builds"| node_results
node_labels -->|"adds predictions"| node_results
node_results -->|"writes"| node_csv
node_notebook -.->|"uses"| node_dataset
node_notebook -.->|"compares"| node_experiments
node_notebook -.->|"optimizes"| node_tuning
node_notebook -.->|"tracks"| node_metrics
node_notebook -.->|"logs experiments"| node_mlflow
node_notebook -.->|"registers model"| node_registry
node_notebook -.->|"uses registry"| node_mlflow

click node_entry "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py"
click node_messages "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py"
click node_model "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl"
click node_vectorizer "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl"
click node_classifier "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl"
click node_labels "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py"
click node_results "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py"
click node_csv "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/test.csv"
click node_notebook "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb"
click node_dataset "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/TurkishSMSCollection.csv"
click node_experiments "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb"
click node_tuning "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb"
click node_metrics "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb"
click node_registry "https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb"

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_entry,node_messages,node_model,node_vectorizer,node_classifier,node_labels,node_results toneBlue
class node_notebook,node_experiments,node_tuning,node_metrics,node_registry,node_mlflow toneAmber
class node_csv,node_dataset toneMint
class node_user toneIndigo
```

## Components

### SMS inference

- [Prediction script](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py): `main.py`
- [Sample messages](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py): `main.py`
- [Trained model](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl): `SMS_Spam_Classifcation.pkl`
- [TF-IDF features](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl): `SMS_Spam_Classifcation.pkl`
- [Tuned LinearSVC](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/SMS_Spam_Classifcation.pkl): `SMS_Spam_Classifcation.pkl`
- [Spam / Normal](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py): `main.py`
- [Result table](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/main.py): `main.py`

### Model development

- [Training workflow](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb): `turkish_SMS_spam_classification.ipynb`
- [Model comparison](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb): `turkish_SMS_spam_classification.ipynb`
- [Hyperparameter tuning](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb): `turkish_SMS_spam_classification.ipynb`
- [Evaluation metrics](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb): `turkish_SMS_spam_classification.ipynb`
- [Model registry](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/turkish_SMS_spam_classification.ipynb): `turkish_SMS_spam_classification.ipynb`

### Data and artifacts

- [CSV results](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/test.csv): `test.csv`
- [SMS dataset](https://github.com/tolgatopaloglu/turkish-sms-spam-detection/blob/main/TurkishSMSCollection.csv): `TurkishSMSCollection.csv`

### Other components

- **Project runner**
- **MLflow**

## Connections

- Project runner → Prediction script: runs
- Prediction script → Trained model: loads
- Prediction script → Sample messages: predicts on
- Prediction script → Trained model: calls predict
- Trained model → TF-IDF features: transforms with
- TF-IDF features → Tuned LinearSVC: provides features
- Tuned LinearSVC → Spam / Normal: classifies as
- Prediction script → Result table: builds
- Spam / Normal → Result table: adds predictions
- Result table → CSV results: writes
- Training workflow → SMS dataset: uses
- Training workflow → Model comparison: compares
- Training workflow → Hyperparameter tuning: optimizes
- Training workflow → Evaluation metrics: tracks
- Training workflow → MLflow: logs experiments
- Training workflow → Model registry: registers model
- Training workflow → MLflow: uses registry
