From 2f2de698b6ea2f7251888f7c7a56a834e2c9226c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=9Acigacz?= Date: Sat, 27 May 2023 17:18:28 +0200 Subject: [PATCH] fix return predictions --- application/services/sentiment_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/services/sentiment_service.py b/application/services/sentiment_service.py index 26b82c0..256dd53 100644 --- a/application/services/sentiment_service.py +++ b/application/services/sentiment_service.py @@ -13,4 +13,8 @@ def get_data(): predicitons = sentiment_prediction(data['sentences']) #predykcje count_labels = count_predictions(predicitons) #dane do wykresu + for i in range(0, len(predicitons)): + predicitons[i]['sentence'] = data['sentences'][i] + predicitons[i]['label'] = predicitons[i]['label'][6:] + return jsonify({"predictions": predicitons, "count_labels": count_labels}) \ No newline at end of file