Skip to content

This repository features a spam/ham text message classifier using NLP techniques. It employs Naive Bayes with TF-IDF for feature extraction, preprocesses data, trains the model, and evaluates performance. Demonstrates NLP's efficacy in spam detection.

License

Notifications You must be signed in to change notification settings

dkv204p/SPAM-HAM-Classification-using-NLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPAM/HAM Classification using NLP

This repository contains code for a machine learning model that classifies text messages as spam or ham (not spam) using Natural Language Processing (NLP) techniques. The model utilizes the Naive Bayes algorithm with TF-IDF (Term Frequency-Inverse Document Frequency) feature extraction. It preprocesses text data, trains the model on labeled examples, and evaluates its performance using accuracy, precision, recall, and F1-score metrics. This project demonstrates how NLP can be applied to solve the problem of spam detection in text messages.

Key Features

  • Preprocessing text data: tokenization, stopword removal, and TF-IDF vectorization.
  • Training a Naive Bayes classifier on labeled text messages.
  • Evaluating model performance using standard classification metrics.
  • Simple and easy-to-understand implementation for spam/ham classification.

Dependencies

  • Python 3.x
  • pandas
  • scikit-learn

Usage

  1. Clone the repository:
  1. Navigate to the project directory:
  • cd spam-ham-classification
  1. Install dependencies:
  • pip install -r requirements.txt
  1. Run the main script:
  • python spam_ham_classification.py

Contributions

Contributions, bug reports, and feature requests are welcome! Please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

This repository features a spam/ham text message classifier using NLP techniques. It employs Naive Bayes with TF-IDF for feature extraction, preprocesses data, trains the model, and evaluates performance. Demonstrates NLP's efficacy in spam detection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages