Skip to content

Puja2007/Spam_Email_Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spam Email Classifier

Project Overview

The Spam Email Classifier is a Machine Learning project that detects whether an email or SMS message is Spam or Not Spam (Ham) based on its content.

The project uses Natural Language Processing (NLP) techniques and the Multinomial Naive Bayes algorithm for text classification.


Features

  • Classifies emails as Spam or Not Spam.
  • Cleans and preprocesses text data.
  • Converts text into numerical features using TF-IDF.
  • Trains a Machine Learning model.
  • Displays model accuracy and evaluation metrics.
  • Allows users to test their own email messages.

Technologies Used

  • Python
  • Pandas
  • NumPy
  • Scikit-learn
  • TF-IDF Vectorizer
  • Multinomial Naive Bayes

Project Structure

Spam_Email_Classifier/
│── spam_classifier.py
│── spam.csv
│── README.md
│── requirements.txt

Installation

Install the required libraries:

pip install pandas numpy scikit-learn

How to Run

Run the following command:

python spam_classifier.py

Sample Output

MODEL PERFORMANCE

Accuracy: 1.0

Enter an email message:
> Congratulations! You have won a free iPhone.

Result: SPAM EMAIL

Machine Learning Algorithm

  • Multinomial Naive Bayes

Dataset

The project uses a CSV file (spam.csv) containing spam and ham email messages.


Future Improvements

  • Build a graphical user interface (GUI).
  • Create a web application using Flask.
  • Use a larger dataset for better accuracy.
  • Compare Naive Bayes with Support Vector Machine (SVM).

Author

Puja Patnabi Sri Kollu

B.Tech Student

Machine Learning Internship Project

About

A Machine Learning-based Spam Email Classifier that detects whether an email or SMS message is Spam or Not Spam using Natural Language Processing (NLP), TF-IDF Vectorization, and the Multinomial Naive Bayes algorithm.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages