Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
|
|
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)
|