Skip to content

Commit c6d3b4e

Browse files
authored
Merge pull request #2066 from Chessing234/fix/cxr-section-idx-separator
Fix CXR last_paragraph section_idx off-by-one
2 parents ea1a037 + 4fe5c35 commit c6d3b4e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎mimic-iv-cxr/txt/section_parser.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def section_text(text):
8383
sections.append('\n \n'.join(sections[-1].split('\n \n')[1:]))
8484
sections[-2] = sections[-2].split('\n \n')[0]
8585
section_names.append('last_paragraph')
86-
section_idx.append(section_idx[-1] + len(sections[-2]))
86+
# include the '\n \n' separator between the split parts
87+
section_idx.append(section_idx[-1] + len(sections[-2]) + len('\n \n'))
8788

8889
return sections, section_names, section_idx
8990

0 commit comments

Comments
 (0)