Git Product home page Git Product logo

shubhamsharma476 / spam-classifier-nlp Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 263 KB

This is a machine learning project that focuses on detecting spam messages from regular messages. The project includes data cleaning and preprocessing, creating a bag of words model, and training the model using the Naive Bayes classifier. The final accuracy of the model is 98.39%.

Jupyter Notebook 100.00%
countvectorizer machine-learning natural-language-processing nltk numpy pandas

spam-classifier-nlp's Introduction

Spam-Classifier-NLP

This repository contains the code for a machine learning model for classifying SMS messages as spam or ham (not spam) using Naive Bayes classifier. The model was trained and tested on a custom dataset of SMS messages.

Dataset:

The dataset used for this project contains SMS messages labeled as spam or ham. The dataset was preprocessed by removing stop words and stemming the remaining words. The dataset was split into training and testing sets.

Data Preprocessing:

Data cleaning and preprocessing were performed on the dataset to remove stop words and reduce words to their stem form. The NLTK library was used for this purpose. The preprocessed text was then converted into a bag of words model using CountVectorizer from the scikit-learn library.

Model:

The model used for this project was Naive Bayes classifier. The model was trained on the preprocessed data using the training set. The accuracy of the model was calculated using the test set, and it achieved an accuracy of 98.39%.

Results:

The final model achieved an accuracy of 98.39% on the test set, indicating that it is highly effective in classifying SMS messages as spam or ham. This model could be further improved by using more advanced algorithms, such as neural networks, or by incorporating additional features, such as message length or time sent.

spam-classifier-nlp's People

Contributors

shubhamsharma476 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.