Skip to content

Instantly share code, notes, and snippets.

@yogeshnile
Created July 15, 2020 10:32
Show Gist options
  • Save yogeshnile/45c5af839e7d9f0922b894fb85b439ab to your computer and use it in GitHub Desktop.
Save yogeshnile/45c5af839e7d9f0922b894fb85b439ab to your computer and use it in GitHub Desktop.
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