File size: 510 Bytes
7ba9378 84de8c5 7ba9378 84de8c5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from flask import Flask, render_template, request, jsonify
import model # Import your model module
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def home():
if request.method == 'POST':
data = request.json
user_input = data['text']
# Use your model to classify the text
prediction = model.classify_text(user_input)
return jsonify({'classification': prediction})
return render_template('home.html')
if __name__ == '__main__':
app.run()
|