Skip to content

Commit

Permalink
fix bug in subset
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen authored Dec 26, 2023
1 parent 96fff7c commit da97b19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/augmenty/doc/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def paragraph_subset_augmenter_v1(

# Respect entity spans
while start != 0 and example.y[start].ent_iob_ not in {"O", "B", ""}:
start = -1
start -= 1
while end < doc_len - 1 and example.y[end + 1].ent_iob_ not in {"O", "B", ""}:
end = +1
end += 1

for k in token_anno:
token_anno[k] = token_anno[k][start:end]
Expand Down

0 comments on commit da97b19

Please sign in to comment.