Skip to content

Sankesh12/Email-SMS-Spam-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“§ Email / SMS Spam Classifier

πŸš€ Project Overview

  • This project is a Machine Learning based web application that classifies Email or SMS messages as Spam or Not Spam.
  • It uses Natural Language Processing (NLP) techniques to preprocess the text and a Multinomial Naive Bayes model to detect spam messages.
  • The application is deployed using Streamlit, making it easy for anyone to use without coding.

πŸ“ Problem Statement

  • Spam messages are unwanted and can cause security risks. This project aims to automatically classify messages as Spam or Not Spam, helping users filter unwanted messages and improve communication efficiency.

πŸ›  Technologies Used

  • Python – Programming language
  • Pandas – Data manipulation
  • NumPy – Numerical operations
  • NLTK – Natural Language Processing (tokenization, stopword removal, stemming)
  • Scikit-learn – Machine Learning library
  • TF-IDF Vectorizer – Feature extraction from text
  • Multinomial Naive Bayes – Machine Learning model for classification
  • Streamlit – Web app deployment

πŸ“Š Model Details

Text Preprocessing:

  • Convert text to lowercase
  • Tokenization (splitting text into words)
  • Stopword removal (removing common words like β€œis”, β€œthe”)
  • Stemming (reducing words to their root form)

Feature Extraction:

  • Using TF-IDF Vectorizer to convert text into numerical features

Model Training:

  • Tested multiple models

Best Model:

  • Multinomial Naive Bayes

Evaluation Metrics:

  • Accuracy: Measures overall correctness
  • Precision: Measures how many predicted spam messages are actually spam

⚑ How to Run the Code

    1. Clone the repository or download the ZIP file
    1. Install required packages:
      • pip install pandas numpy nltk scikit-learn streamlit
    1. Run the Streamlit app:
      • streamlit run app.py
    1. Open the web app in your browser
    1. Enter any Email or SMS text and click Predict to see if it’s Spam or Not Spam

About

Built an Email/SMS Spam Classifier using NLP πŸ“§ Preprocessed text (tokenization, stopword removal, stemming) πŸ”Ž Applied TF-IDF for feature extraction πŸ“Š Trained multiple ML models and selected Multinomial Naive Bayes βœ… Deployed a Streamlit web app for real-time prediction 🌐

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors