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.
Here's a list of files in the directories:
app.py
: Contains the code for the Dash front endmodel.py
: Contains the code for the text parser used in the modelassets
: Directory that contains files used in the front end, including the backgrounds, CSS, and the saved ML model
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 theFrontEnd/assets/ml_models
folderinput
: Contains the spam/non-spam data used to train the model
In order to start the Dash application, do the following:
- Clone the repo
git clone https://github.com/mdylan2/naive_bayes_sms_classifier.git
- Navigate into the folder, set up a virtual environment and activate it
- Once you've activated the virtual environment, install the requirements
pip install -r requirements.txt
- Navigate into the Notebook folder and run the entire
sms-classifier
notebook to generate the spam classification model - Navigate into the FrontEnd folder and run the following command:
python app.py
Always open to any questions or contributions! Please reach out to me on Github.