16 lines
438 B
Python
16 lines
438 B
Python
|
from flask import(
|
||
|
request,
|
||
|
jsonify,
|
||
|
Blueprint,
|
||
|
)
|
||
|
from application.functions.tone import tone_prediction, clear_data
|
||
|
|
||
|
tone_service = Blueprint("tone_service", __name__)
|
||
|
|
||
|
@tone_service.route("/get_tone_data", methods=['POST'])
|
||
|
def get_data():
|
||
|
data = request.get_json()
|
||
|
data_clear = clear_data(data['sentences'])
|
||
|
predicitons = tone_prediction(data_clear)
|
||
|
|
||
|
return jsonify({"predictions": predicitons})
|