Skip to content
Snippets Groups Projects
Unverified Commit 829ad8f7 authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Fix entity splitting

parent d52df58b
No related branches found
No related tags found
No related merge requests found
......@@ -326,7 +326,8 @@ def process_image(
"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])
# We go up to -1 so that the last token matches until the end of the text
for current, next_token in pairwise(index + [-1])
]
result["confidences"]["total"] = np.around(np.mean(char_confidences), 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment