Skip to content

This project is a simple yet effective web application that classifies messages as spam or not spam. It uses a TF-IDF vectorizer and a Multinomial Naive Bayes model trained on labeled SMS data. The interface is built with Streamlit, and the preprocessing is handled using regular expressions—no external NLP libraries like NLTK required.

Notifications You must be signed in to change notification settings

anwitarajendra/ML-Model-for-Spam-Detection

Repository files navigation

📬 Email/SMS Spam Classifier 🕵️‍♀️

A lightweight, ML-powered web app to detect whether a message is 🚫 spam or ✅ legit. Built using Python, scikit-learn, and Streamlit — no NLTK, no fuss!


🧠 Tech Stack

🖥️ Frontend:
• Streamlit (for the interactive web interface)
🧪 Backend & ML:
• Scikit-learn
• Pandas, NumPy
• Regex (for tokenization & preprocessing)
• TF-IDF vectorizer + Multinomial Naive Bayes model


🚀 Features

✨ Minimal UI — enter any message to test
📊 Pre-trained ML model (no need to retrain)
🧼 Clean, regex-based preprocessing
📦 No NLTK or heavy dependencies
💻 One-click local deployment


🗃️ Folder Structure

📁 email-spam-classifier/
├── app.py              # Streamlit app script
├── vectorizer.pkl      # Saved TF-IDF vectorizer
├── spam_model.pkl      # Trained Naive Bayes model
└── README.md           # You are here!

🛠️ How to Run Locally

  1. ⬇️ Clone the repository:
git clone https://github.com/your-username/email-spam-classifier.git
cd email-spam-classifier
  1. 📦 Install the dependencies:

    pip install -r requirements.txt
    
    
    
  2. ▶️ Launch the Streamlit app:

    streamlit run app.py
    
    

🌐 The app will open in your browser at:

http://localhost:8501

About

This project is a simple yet effective web application that classifies messages as spam or not spam. It uses a TF-IDF vectorizer and a Multinomial Naive Bayes model trained on labeled SMS data. The interface is built with Streamlit, and the preprocessing is handled using regular expressions—no external NLP libraries like NLTK required.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published