├── Procfile
├── cv-transform.pkl
├── static
├── spam.webp
├── not-spam.webp
├── spam-favicon.ico
└── styles.css
├── spam-sms-mnb-model.pkl
├── readme_resources
├── spam-sms-web-app.gif
└── application-error-heroku.png
├── requirements.txt
├── app.py
├── README.md
├── templates
├── home.html
└── result.html
└── Spam SMS Classifier - Deployment.py
/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn app:app
--------------------------------------------------------------------------------
/cv-transform.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/cv-transform.pkl
--------------------------------------------------------------------------------
/static/spam.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/static/spam.webp
--------------------------------------------------------------------------------
/static/not-spam.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/static/not-spam.webp
--------------------------------------------------------------------------------
/spam-sms-mnb-model.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/spam-sms-mnb-model.pkl
--------------------------------------------------------------------------------
/static/spam-favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/static/spam-favicon.ico
--------------------------------------------------------------------------------
/readme_resources/spam-sms-web-app.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/readme_resources/spam-sms-web-app.gif
--------------------------------------------------------------------------------
/readme_resources/application-error-heroku.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujvyas/Spam-SMS-Classifier-Deployment/master/readme_resources/application-error-heroku.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask==1.1.1
2 | gunicorn==19.9.0
3 | itsdangerous==1.1.0
4 | Jinja2==2.10.1
5 | MarkupSafe==1.1.1
6 | Werkzeug==0.15.5
7 | numpy>=1.9.2
8 | scipy>=0.15.1
9 | scikit-learn>=0.18
10 | matplotlib>=1.4.3
11 | pandas>=0.19
12 |
--------------------------------------------------------------------------------
/app.py:
--------------------------------------------------------------------------------
1 | # Importing essential libraries
2 | from flask import Flask, render_template, request
3 | import pickle
4 |
5 | # Load the Multinomial Naive Bayes model and CountVectorizer object from disk
6 | filename = 'spam-sms-mnb-model.pkl'
7 | classifier = pickle.load(open(filename, 'rb'))
8 | cv = pickle.load(open('cv-transform.pkl','rb'))
9 | app = Flask(__name__)
10 |
11 | @app.route('/')
12 | def home():
13 | return render_template('home.html')
14 |
15 | @app.route('/predict',methods=['POST'])
16 | def predict():
17 | if request.method == 'POST':
18 | message = request.form['message']
19 | data = [message]
20 | vect = cv.transform(data).toarray()
21 | my_prediction = classifier.predict(vect)
22 | return render_template('result.html', prediction=my_prediction)
23 |
24 | if __name__ == '__main__':
25 | app.run(debug=True)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Spam SMS Classification - Deployment
2 |   
3 |
4 | • This repository consists of files required to deploy a ___Machine Learning Web App___ created with ___Flask___ on ___Heroku___ platform.
5 |
6 | • If you want to view the deployed model, click on the following link:
7 | Deployed at: _https://spam-sms-detector.herokuapp.com/_
8 |
9 | • If you are searching for __Code, Algorithms used and Accuracy of the model__.. you won't find it here. Click the link mentioned below for the same:
10 | Link: _https://github.com/anujvyas/Natural-Language-Processing-Projects/tree/master/Spam%20SMS%20Classification_
11 |
12 | • Please do ⭐ the repository, if it helped you in anyway.
13 |
14 | • A glimpse of the web app:
15 |
16 | 
17 |
18 | _**----- Important Note -----**_
19 | • If you encounter this webapp as shown in the picture given below, it is occuring just because **free dynos for this particular month provided by Heroku have been completely used.** _You can access the webpage on 1st of the next month._
20 | • Sorry for the inconvenience.
21 |
22 | 
23 |
--------------------------------------------------------------------------------
/templates/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
A Machine Learning Web App, Built with Flask, Deployed using Heroku.
19 |A Machine Learning Web App, Built with Flask, Deployed using Heroku.
19 |
27 | {% elif prediction==0 %}
28 |
30 | {% endif %}
31 |