ragilbuaj commited on
Commit
30681bf
1 Parent(s): 0df8910

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -1,14 +1,14 @@
1
- from flask import Flask, request, jsonify
2
- from api.predict import predict
3
-
4
- app = Flask(__name__)
5
-
6
- @app.route('/predict', methods=['POST'])
7
- def predict_route():
8
- data = request.get_json()
9
- text = data.get('text')
10
- result = predict(text)
11
- return jsonify({"sentiment": result})
12
-
13
- if __name__ == '__main__':
14
- app.run(host='0.0.0.0', port=8000)
 
1
+ from flask import Flask, request, jsonify
2
+ from api.predict import predict
3
+
4
+ app = Flask(__name__)
5
+
6
+ @app.route('/predict', methods=['POST'])
7
+ def predict_route():
8
+ data = request.get_json()
9
+ text = data.get('text')
10
+ result = predict(text)
11
+ return jsonify({"sentiment": result})
12
+
13
+ if __name__ == '__main__':
14
+ app.run(host='0.0.0.0', port=8501)