diff --git a/dan/predict/prediction.py b/dan/predict/prediction.py index 357bb4df1854a64af8b0e65794960c1fc628e2a8..4b5c33d1722d6273423588832ff4c4fd6d79800a 100644 --- a/dan/predict/prediction.py +++ b/dan/predict/prediction.py @@ -353,8 +353,8 @@ def run( result["confidences"]["by ner token"] = [ { - "text": f"{text[current: next_token-1]}", - "confidence_ner": f"{np.around(np.mean(char_confidences[current : next_token-1]), 2)}", + "text": f"{text[current: next_token]}", + "confidence_ner": f"{np.around(np.mean(char_confidences[current : next_token]), 2)}", } for current, next_token in pairwise(index + [0]) ]