Skip to content

Commit

Permalink
Merge pull request #220 from KennethEnevoldsen/KennethEnevoldsen-patch-2
Browse files Browse the repository at this point in the history
fix bug in subset
  • Loading branch information
KennethEnevoldsen authored Dec 26, 2023
2 parents 31dda40 + 9027a49 commit 49784ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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
while end < doc_len - 1 and example.y[end + 1].ent_iob_ not in {"O", "B", ""}:
end = +1
start -= 1
while end < doc_len - 1 and example.y[end - 1].ent_iob_ not in {"O", "B", ""}:
end += 1

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

0 comments on commit 49784ea

Please sign in to comment.