Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FILTER FOX - SMS SPAM DETECTOR

A Machine Learning powered web application that classifies SMS messages as Spam or Not Spam. The project is built using Python, Flask, Scikit-learn, NLTK, and a Voting Classifier for robust spam detection.


Demo

Deployment Link: --- https://filter-fox-sms-spam-detector.vercel.app


Features

  • Detects whether an SMS message is Spam or Not Spam.
  • Complete text preprocessing pipeline.
  • TF-IDF Vectorization.
  • Ensemble Voting Classifier.
  • Flask backend with HTML & CSS frontend.
  • Fast real-time prediction.

Tech Stack

Machine Learning

  • Python
  • Scikit-learn
  • NLTK
  • TF-IDF Vectorizer
  • Voting Classifier

Web Development

  • Flask
  • HTML5
  • CSS3
  • JavaScript

Machine Learning Pipeline

  1. Data Cleaning
  2. Exploratory Data Analysis (EDA)
  3. Text Preprocessing
    • Lowercasing
    • Tokenization
    • Removing Special Characters
    • Stopword Removal
    • Stemming
  4. TF-IDF Vectorization
  5. Model Training
  6. Hyperparameter Tuning
  7. Model Evaluation
  8. Voting Ensemble
  9. Deployment

Models Evaluated

  • Multinomial Naive Bayes
  • Logistic Regression
  • Support Vector Machine (SVM)
  • K-Nearest Neighbors (KNN)
  • Decision Tree
  • Extra Trees Classifier
  • XGBoost
  • Voting Classifier

Final Model

The final deployed model is a Voting Classifier consisting of:

  • Multinomial Naive Bayes
  • Extra Trees Classifier

This combination achieved the best balance between precision and recall while maintaining zero false positives on the test set.


Evaluation

The project was evaluated using:

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Cross Validation
  • Confusion Matrix

Since the business objective was to never classify a legitimate (ham) message as spam, Precision was treated as the primary evaluation metric.


Project Structure

FILTERFOX-SMS-Spam-Detector/
│
├── api/
├── data/
├── model/
├── notebooks/
├── static/
├── templates/
├── README.md
├── requirements.txt
├── .gitignore
└── README.md

⚙️ Installation

Clone the repository

git clone https://github.com/ak-junior3339/FilterFox-SMS-Spam-Detector.git

Navigate to the project

cd FilterFox-SMS-Spam-Detector

Create a virtual environment

python -m venv venv

Activate the virtual environment

macOS/Linux

source venv/bin/activate

Windows

venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

Run the Flask application

python api/index.py

Example

Input

Congratulations! You have won a FREE iPhone. Click the link below to claim your prize

Prediction

Spam

What I Learned

  • End-to-end Machine Learning workflow
  • NLP text preprocessing
  • TF-IDF Vectorization
  • Model evaluation and comparison
  • Hyperparameter tuning
  • Ensemble Learning
  • Flask backend development
  • Frontend integration using HTML, CSS, and JavaScript
  • Model deployment

License

This project is licensed under the MIT License.


Author

Aishwarya Kumar Singh

If you found this project helpful, consider giving it a ⭐ on GitHub!

About

Developed an end-to-end SMS Spam Detection application using NLP and Machine Learning. Evaluated multiple classification algorithms, selected an optimized Voting Classifier, and deployed the application with Flask and Vercel for real-time spam prediction.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages