Created
July 15, 2020 10:32
-
-
Save yogeshnile/45c5af839e7d9f0922b894fb85b439ab 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
app = Flask(__name__) | |
@app.route('/') | |
def home(): | |
return render_template('index.html') | |
@app.route('/result', methods=['POST','GET']) | |
def predict(): | |
if request.method == 'POST': | |
message = request.form['message'] | |
if not message == "": | |
if predict_spam(message): | |
return render_template('index.html', result = 0, message = message) | |
else: | |
return render_template('index.html', result = 1, message = message) | |
else: | |
return render_template('index.html') | |
else: | |
return render_template('index.html') | |
if __name__ == '__main__': | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment