-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.py
31 lines (25 loc) · 900 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from flask import Flask, render_template, url_for, request
import re
import functions.spell_correction as spell
import functions.text_classifier as classifier
app = Flask(__name__)
@app.route('/')
def index():
return render_template("spell.html")
@app.route('/classifier')
def classify():
return render_template("classifier.html")
@app.route('/spell', methods=['POST'])
def process():
if request.method == 'POST':
raw_text = request.form['rawtext']
results = spell.correct(raw_text)
return render_template("spell.html", results=results,raw_text=raw_text)
@app.route('/classifier', methods=['POST'])
def classify2():
if request.method == 'POST':
raw_text = request.form['rawtext']
results = classifier.BigClassifier(raw_text)
return render_template("classifier.html", results=results,raw_text=raw_text)
if __name__ == '__main__':
app.run(debug=True)