Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nishant2018/email-sms-classification
This is the nlp task for sms and email spam classification.
https://github.com/nishant2018/email-sms-classification
Last synced: 3 days ago
JSON representation
This is the nlp task for sms and email spam classification.
- Host: GitHub
- URL: https://github.com/nishant2018/email-sms-classification
- Owner: Nishant2018
- Created: 2023-11-27T12:09:54.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-05T11:58:46.000Z (7 months ago)
- Last Synced: 2024-04-05T12:43:51.719Z (7 months ago)
- Language: Jupyter Notebook
- Size: 1.21 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Deploying NLP Model using Flask
This is a simple project to elaborate how to deploy a NLP model using Flask API
Prerequisites
You must have Scikit Learn,nltk==3.7
flask==3.0.0
scikit-learn==1.3.2
and joblib==1.3.2 installed.Project Structure
This project has four major parts :
sms-spam-classification-nlp.ipynb - This contains code for our NLP model to predict whether the sms or email is spam or not.
app.py - This contains Flask APIs that receives email or sms(text) through GUI or API calls, computes the precited value based on our model and returns it.
template - This folder contains the HTML template (index.html) to allow user to enter sms/email and displays the predicted output (Spam or Not Spam).
static - This folder contains the css folder with style.css file which has the styling required for out index.html file.
Running the projectEnsure that you are in the project home directory. Create the machine learning model by running below command from command prompt -
python app.py
This would create a serialized version of our model into a file nlp_model.pkl
Run app.py using below command to start Flask API
python app.py
By default, flask will run on port 5000.
Navigate to URL http://127.0.0.1:5000/ (or) http://localhost:5000
You should be able to view the homepage.Enter sms/email(text) in input box and hit Predict.
If everything goes well, you should be able to see the predcited output on the HTML page! check the output here: http://127.0.0.1:5000/predict