๐Ÿ“ฉ Spam Classification using Natural Language Processing (NLP)

MAIN TOOL

Python

Secondary tool

NLTK and Scikit learn

INDUSTRY

Natural Language Processing for spam detection

๐Ÿ“š About the Project

๐Ÿš€ Overview

This project showcases aย Spam Classification Systemย built usingย Natural Language Processing (NLP)ย techniques. The classification was performed usingย Logistic Regressionย andย Multinomial Naive Bayes, comparing their effectiveness on a dataset of spam and ham (non-spam) messages.

๐Ÿ† Key Features

  • Preprocessing & Feature Engineering: Tokenization, stopword removal, lemmatization, and TF-IDF vectorization.
  • Supervised Learning Models: Logistic Regression & Naive Bayes.
  • Performance Evaluation: Classification reports, confusion matrices, ROC & Precision-Recall curves.
  • Decision Boundary Visualization: Graphical representation of model performance.

๐Ÿ“Š Model Performance

๐Ÿ”น Logistic Regression Classification Report

Logistic Regression Report

๐Ÿ”น Naive Bayes Classification Report

Naive Bayes Report


๐Ÿ›  Confusion Matrices

๐Ÿ”น Logistic Regression

Logistic Regression Confusion Matrix

๐Ÿ”น Naive Bayes

Naive Bayes Confusion Matrix


๐ŸŽฏ Decision Boundary

A visual representation of how Logistic Regression classifies spam vs. non-spam messages.

Decision Boundary


๐Ÿ“ˆ ROC Curves

๐Ÿ”น Logistic Regression

ROC Logistic Regression

๐Ÿ”น Naive Bayes

ROC Naive Bayes


๐Ÿ“‰ Precision-Recall Curves

๐Ÿ”น Logistic Regression

Precision Recall Curve Logistic Regression

๐Ÿ”น Naive Bayes

Precision Recall Curve Naive Bayes


๐Ÿ—๏ธ Tech Stack

  • Python
  • Scikit-Learn
  • NLTK
  • Matplotlib & Seaborn

๐Ÿ“Œ How to Run the Project

# Clone the repository
$ git clone https://github.com/SYEDFAIZAN1987/Spam-Classification-using-Natural-Language-Processing.git

# Navigate to the directory
$ cd Spam-Classification-using-Natural-Language-Processing

# Install dependencies
$ pip install -r requirements.txt

# Run the Jupyter Notebook
$ jupyter notebook
ย 

๐Ÿค Contributions

Contributions, issues, and feature requests are welcome! Feel free toย forkย the repository and submit aย pull request.


๐Ÿ“œ License

This project is licensed under theย MIT License.


๐Ÿ’ฌ Connect with Me

LinkedIn

๐Ÿ”ฅ If you found this project useful, don’t forget toย star โญ the repository!