ML-powered Flask app to perform spam classification of SMS messages using TF-IDF vectorization.
Make sure that you have the following:
Python 3+ and pip (which comes with Python 3+)
Run the following command on the root directory of this project:
Optional commands to create virual environment:
- Create virtual environment:
python -m venv Spam-Classifier
- Activate virual environment:
Spam-Classifier\Scripts\activate
Command to start server:
- Install Dependency:
pip install -r requirements.txt
flask run
This will start flask based spam classifier server in production mode.
To access home page browse to http:https://localhost:5000
To start python notebook from within python virtual environment follow below commands:
python -m pip install jupyter
jupyter notebook
- Open
Data Analysis and Modelling.ipynb
from browser
localhost:5000\train
will load dataset and create vocabulary, train Naive Bayes model using that.localhost:5000\
is the main page of the web app.localhost:5000\predict
will predict the class of text passed. This api will load trained model which were created fromlocalhost:5000\train
and use it for prediction.