Repository navigation
Conversation
Signed-off-by: its-amann <amanagnihotri902@gmail.com>
|
✅ DCO Check Passed Thanks @its-amann, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit This change adds nested list detection in PDF reading order based on horizontal indentation. It also recognizes Word circle bullet markers on list items and extracts them into CI safety: no concern found. A maintainer must still approve CI. The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at e256508ce6. It read the code and did not run it.
The list-nesting and o-marker changes are logically correct. The list_stack is not cleared when _handle_text_element resets current_list to None for a non-list, non-form element (e.g. a section header between nested list items), but the current_list is None guard at line 758 of readingorder_model.py clears the stale stack before it is ever used, so no incorrect output results. The reviewer should confirm that the column-detection condition (rel.t >= previous_list_element.t - indent_tolerance) uses bottom-left-origin coordinates consistently with how rel.t is populated in _assembled_to_readingorder_elements.
A maintainer makes the merge decision. This review never approves the pull request.
|
Tested e256508 with docling-core 2.104.0 on five public Norwegian PDFs, against the base of this PR (821526e). The text is the same in all five. Only the list structure changes.
One case nests items that are siblings: a quoted list whose first item starts with «. On page 3 of HR-2026-2227-A, the quoted judgment In Markdown, the marker is still printed ( |
Signed-off-by: its-amann <amanagnihotri902@gmail.com>
|
Thanks @morten-lagabote for testing the extra PDFs and giving the exact coordinates. I reproduced the three findings. Pushed ad4fc36 with the reading-order fixes:
Rechecked KOFA pages 2–3, HR-2026-2227-A pages 3–4, and the recovery guidelines pages 3–4 and 17. Text and provenance match the previous PR head. The four page-range checks pass, as do 90 focused tests (1 dataset test skipped), You are also right about Markdown @cau-git, the reading-order update is ready for another look when you have time. The full upstream CI still needs maintainer approval. |
|
Reran on ad4fc36 with the same five PDFs. The two reading-order cases are fixed:
The text of all five PDFs is the same as on the base. The only change in order is in the guidelines: in three places, list items that continue on the next page now come before the footnotes of the previous page, not after them. KOFA 2018/246 is the same as with e256508. |
|
Thanks @morten-lagabote for rerunning all five PDFs and confirming both fixes. I checked the footnote order too. Keeping the continued list in one group is intentional; the footnote reordering is a consequence of that grouping. The next-page items are added to the existing list group, while the footnotes remain separate body items. Tree traversal therefore visits the continued items before those footnotes. The footnote text, labels and page coordinates are unchanged, but their position in the traversal changes. I should have called out that distinction in the earlier validation summary: unchanged text and provenance do not mean unchanged traversal order. @cau-git, is keeping the logical list contiguous the preferred behavior here, or should the previous page's footnotes remain interleaved before its continuation? Preserving both needs explicit handling of that boundary, so I don't want to treat the changed order as automatically correct. |
Group PDF list items by horizontal indentation, attach nested groups to their parent item, and return to the outer list on an outdent. Lists continue across page headers, footers and footnotes. A new column or body paragraph starts a separate list.
Keep quoted numbered siblings at the same level when an opening quote hangs left of the marker. Use the text-line height and matching marker format to distinguish this from a real sublist, including when the parent spans several lines.
Recognise Word's ASCII
ocircle on items already detected as list items. Store it inmarker, remove it fromtext, and preserveorig. Ordinary prose is unchanged.Issue resolved by this Pull Request:
Resolves #5020
Checklist:
Validation:
make validate, wheel/sdist builds and whitespace checks pass. The five focused type warnings match the previous PR head.Related export behavior:
Default Markdown still needs a companion
docling-corechange: itsAUTOmode prints the stored alphabeticomarker again. That patch is implemented and tested separately; it preserves the document fields andALWAYSbehavior. Publication is pending, and the link will be added here. The SymbolMT font issue remains tracked in docling-project/docling-parse#416.Thanks @morten-lagabote for testing the additional PDFs and identifying the quoted-list and footnote cases. @cau-git and @PeterStaar-IBM, the updated reading-order changes are ready for review.