Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/ui', methods=['GET', 'POST'])
- def ui_check():
- comment = ''
- banned = False
- if 'comment' in request.form:
- comment = request.form['comment']
- X = word_vectorizer.transform([comment])
- prediction = model.predict(X)
- banned = int(prediction[0])
- banned = banned == 1
- return render_template('form.html', banned=banned, comment=comment)
Add Comment
Please, Sign In to add comment