Guest User

Untitled

a guest
May 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. @app.route('/ui', methods=['GET', 'POST'])
  2. def ui_check():
  3. comment = ''
  4. banned = False
  5. if 'comment' in request.form:
  6. comment = request.form['comment']
  7. X = word_vectorizer.transform([comment])
  8. prediction = model.predict(X)
  9. banned = int(prediction[0])
  10. banned = banned == 1
  11. return render_template('form.html', banned=banned, comment=comment)
Add Comment
Please, Sign In to add comment