File size: 449 Bytes
fff5045
 
 
 
 
 
 
 
 
 
 
 
14406ca
 
 
fff5045
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/')
def index():
    return "Welcome to the AI application!"

@app.route('/predict', methods=['POST'])
def predict():
    data = request.json
    text = data.get('text')
    # Example prediction logic
    result = "example result"  # Replace with actual model prediction logic
    return jsonify({'prediction': result})

if __name__ == "__main__":
    app.run(debug=True)