-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
35 lines (28 loc) · 715 Bytes
/
app.py
File metadata and controls
35 lines (28 loc) · 715 Bytes
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
32
33
34
35
"""
Flask Checkpoints
"""
from flask import Flask, request, jsonify
from flask_cors import CORS
from sentimint import absa
app = Flask(__name__)
CORS(app)
@app.route('/test', methods=['POST'])
def test():
"""
adds two numbers
Returns:
_type_: _description_
"""
return jsonify({'result': "Working Test Passed"}), 200
@app.route('/absa', methods=['POST'])
def absa_one():
"""
Adds two numbers provided in the JSON payload.
Returns:
JSON: A JSON response containing the sum of the two numbers.
"""
data = request.json
review = data['text']
return jsonify({'result': absa(review)})
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5000)