Skip to content

A Naive Bayes Spam Classifiers for SMS messages with a front end

Notifications You must be signed in to change notification settings

mdylan2/naive_bayes_sms_classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Naive Bayes Spam Classifier for SMS

Description

This repository contains the Python code used to build a Naive Bayes SMS Spam Classifier along with a Dash front end. Users can type in a message in a text box and the model will print whether or not the given message is spam.

The application was designed using Pandas, Scikit Learn and Dash.

Just a heads up, the model is VERY naive.

Files

Here's a list of files in the directories:

FrontEnd

  • app.py: Contains the code for the Dash front end
  • model.py: Contains the code for the text parser used in the model
  • assets: Directory that contains files used in the front end, including the backgrounds, CSS, and the saved ML model

Notebook

This directory contains the notebook and data used to generate the model

  • sms-classifier.ipynb: The notebook that describes how the model was generated. After running the entire notebook, the model should save inside the FrontEnd/assets/ml_models folder
  • input: Contains the spam/non-spam data used to train the model

Usage

In order to start the Dash application, do the following:

  1. Clone the repo
git clone https://github.com/mdylan2/naive_bayes_sms_classifier.git
  1. Navigate into the folder, set up a virtual environment and activate it
  2. Once you've activated the virtual environment, install the requirements
pip install -r requirements.txt
  1. Navigate into the Notebook folder and run the entire sms-classifier notebook to generate the spam classification model
  2. Navigate into the FrontEnd folder and run the following command:
python app.py

Frontend Appearance

Spam Message

Spam

Non-Spam Message

Non-Spam

Questions Or Contributions

Always open to any questions or contributions! Please reach out to me on Github.

About

A Naive Bayes Spam Classifiers for SMS messages with a front end

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages