Created
May 27, 2020 17:26
-
-
Save maze-runnar/6302cb87ddf007523ca7a11f7d42b54f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import svmprediction = clf.classify_many(my_msg) ## make your prediction here | |
from joblib import dump, load | |
## loading the model | |
clf = load('/home/saurabh/Desktop/smsspamcollection/frontend/model1.joblib') | |
@app.route('/', methods = ["GET","POST"]) | |
def index(): | |
if(request.method == "POST"): | |
#city = request.form['city'] | |
text_msg = request.form['sms'] | |
my_msg = find_features(text_msg) | |
x = "" | |
if(prediction[0] == 0): | |
x = "Not a spam, it's ok " | |
else: | |
x = "it's a spam" | |
return render_template('mainpage.html',prediction = x) | |
else: | |
return render_template('mainpage.html') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment