From 3a1fea7376886822f9cdf44d39385ed009d0182c Mon Sep 17 00:00:00 2001 From: M Generali <mgenerali@teklia.com> Date: Mon, 26 Jun 2023 14:43:29 +0000 Subject: [PATCH] add space instead of \n in entities --- dan/predict/prediction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dan/predict/prediction.py b/dan/predict/prediction.py index 4b5c33d1..1c2e3954 100644 --- a/dan/predict/prediction.py +++ b/dan/predict/prediction.py @@ -353,7 +353,7 @@ def run( result["confidences"]["by ner token"] = [ { - "text": f"{text[current: next_token]}", + "text": f"{text[current: next_token]}".replace("\n", " "), "confidence_ner": f"{np.around(np.mean(char_confidences[current : next_token]), 2)}", } for current, next_token in pairwise(index + [0]) -- GitLab