BaljinderH's picture
Update app.py
1e44bda verified
raw
history blame
504 Bytes
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.predict(user_input)
return jsonify({'classification': prediction})
return render_template('home.html')
if __name__ == '__main__':
app.run()