exact_data2023/application/services/tone_services.py
2023-06-14 00:03:39 +02:00

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})