File size: 474 Bytes
a5fb347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

from flask import Flask, request, render_template
from predict import Predict

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('index.html')

@app.route('/predict', methods=['POST'])
def predict():
    feature_list = request.form.to_dict()
    result = Predict().predict(feature_list['code'])
    return render_template('index.html', prediction_text=result)

if __name__ == "__main__":
    app.run(debug=True, use_reloader=False, port='8080')