Skip to content

Instantly share code, notes, and snippets.

@maze-runnar
Created May 27, 2020 17:26
Show Gist options
  • Save maze-runnar/6302cb87ddf007523ca7a11f7d42b54f to your computer and use it in GitHub Desktop.
Save maze-runnar/6302cb87ddf007523ca7a11f7d42b54f to your computer and use it in GitHub Desktop.
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