Skip to content

About

An NLP-based machine learning model to detect and classify spam text messages using Python and Jupyter Notebooks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Spam Classifier (SMS & Email)

📌 Overview

This project is a Machine Learning + Flask + MySQL pipeline that classifies SMS and Email messages as Spam 🚨 or Not Spam ✅.
It demonstrates end‑to‑end skills: data preprocessing, model training, web app development, database integration, and deployment readiness.


📁 Project Structure

ML_Projects/
├── app.py                  # Flask main app
├── spam.csv                # Dataset
├── trained_model.pkl       # Saved ML model
├── vectorizer.pkl          # TF-IDF vectorizer
├── requirements.txt        # Dependencies
├── README.md               # Project documentation
├── templates/              # HTML templates
│   ├── home.html
│   ├── sms.html
│   ├── email.html
│   └── history.html
└── DB/                     # Database scripts
    ├── schema.sql          # Table creation
    └── seed.sql            # Sample data insert

📈 Model Performance & Evaluation

During development, multiple Naive Bayes variants were evaluated. Multinomial Naive Bayes (MNB) was selected as the final production model due to its flawless precision, ensuring critical user messages are never misclassified as spam.

Model Variant Accuracy Precision Why it matters
Multinomial NB 97.1% 100% Selected: Zero false positives. Safe for user inboxing.
Bernoulli NB 98.4% 99.2% High accuracy, but allowed some false positives.
Gaussian NB 86.9% 50.7% High error rate; underperformed on text data.

🛠️ Tech Stack & Methods Used

  • Algorithms: Multinomial, Bernoulli, and Gaussian Naive Bayes
  • NLP Techniques: TF-IDF Vectorization, Text Tokenization, Stop-word handling
  • Deployment Pipeline: Flask Web Framework, MySQL Database backend

About

An NLP-based machine learning model to detect and classify spam text messages using Python and Jupyter Notebooks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages