Skip to content

Commit

Permalink
fix eos bounds when creating paragraph subsets
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen authored Dec 26, 2023
1 parent da97b19 commit 9027a49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/augmenty/doc/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def paragraph_subset_augmenter_v1(
# Respect entity spans
while start != 0 and example.y[start].ent_iob_ not in {"O", "B", ""}:
start -= 1
while end < doc_len - 1 and example.y[end + 1].ent_iob_ not in {"O", "B", ""}:
while end < doc_len - 1 and example.y[end - 1].ent_iob_ not in {"O", "B", ""}:
end += 1

for k in token_anno:
Expand Down

0 comments on commit 9027a49

Please sign in to comment.