ydshieh HF staff commited on
Commit
b9379a4
1 Parent(s): 399bd55

Update processing_kosmos2.py

Browse files
Files changed (1) hide show
  1. processing_kosmos2.py +2 -1
processing_kosmos2.py CHANGED
@@ -529,7 +529,8 @@ def extract_entities_with_patch_indices(text):
529
  phrase_tag, phrase, match_content = match.groups()
530
  if not phrase_tag:
531
  phrase = None
532
- span = (None, None)
 
533
 
534
  # Split the match_content by the delimiter to get individual patch_index pairs
535
  patch_index_pairs = match_content.split('</delimiter_of_multi_objects/>')
 
529
  phrase_tag, phrase, match_content = match.groups()
530
  if not phrase_tag:
531
  phrase = None
532
+ # We take the starting position of `<object>`
533
+ span = (match.span(0)[0], match.span(0)[0])
534
 
535
  # Split the match_content by the delimiter to get individual patch_index pairs
536
  patch_index_pairs = match_content.split('</delimiter_of_multi_objects/>')