Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
geli-gel committed Sep 2, 2023
1 parent 28cdf50 commit d9b2b77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = 'mmda'
version = '0.9.13'
version = '0.9.14'
description = 'MMDA - multimodal document analysis'
authors = [
{name = 'Allen Institute for Artificial Intelligence', email = '[email protected]'},
Expand Down
4 changes: 2 additions & 2 deletions src/mmda/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def box_groups_to_span_groups(
# a token is not found to be overlapping with the box, but MergeSpans decides it is close enough to be merged)
for sg_token in sg_tokens:
if sg_token not in all_tokens_overlapping_box_group:
if token_box_in_box_group:
if token_box_in_box_group and sg_token in all_page_tokens[sg_token.box_group.boxes[0].page]:
all_page_tokens[sg_token.box_group.boxes[0].page].remove(sg_token)
else:
elif not token_box_in_box_group and sg_token in all_page_tokens[sg_token.spans[0].box.page]:
all_page_tokens[sg_token.spans[0].box.page].remove(sg_token)

derived_span_groups.append(
Expand Down

0 comments on commit d9b2b77

Please sign in to comment.