Repository navigation
fix(latex): backend updates for better parsing of arxiv papers - #4817
Conversation
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
|
✅ DCO Check Passed Thanks @PeterStaar-IBM, all your commits are properly signed off. 🎉 |
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 Require two reviewer for test updatesWhen test data is updated, we require two reviewers
|
AI triage (advisory)Checked commit Warning The AI analysis did not finish. Only the deterministic checks are shown. CI safety: needs maintainer care before you approve CI.
Possibly related pull requests
Reference data changes
Only the first 80 of 116 reference files were compared. The |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 8d4f1f97d9. It read the code and did not run it.
The code changes are logically sound. The main risk is that the PR description is empty and does not explain why arXiv-2501.01300v2_main.tex.md loses 3 lines of content and one text item is dropped. The reviewer must confirm those removals are intentional improvements, not regressions.
A maintainer makes the merge decision. This review never approves the pull request.
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the changes since 8d4f1f97d9 at 17f5c19d36. It read the code and did not run it.
The bibliography change now builds each entry from _nodes_to_text, which handles \href differently from the old path. The reference data changed in 14 files and the description gives no before/after evidence. The reviewer must check the 2412.19437 and arXiv-2501.01300v2 diffs, and a \bibitem that contains \href.
Earlier findings
- open (question): 3 lines of Markdown output removed without explanation (arXiv-2501.01300v2_main.tex.md)
A maintainer makes the merge decision. This review never approves the pull request.
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
…ction-headers, captions and meta-data Signed-off-by: Peter Staar <taa@zurich.ibm.com>
I, Peter Staar <taa@zurich.ibm.com>, hereby add my Signed-off-by to this commit: 17f5c19 Signed-off-by: Peter Staar <taa@zurich.ibm.com>
geoHeil
left a comment
There was a problem hiding this comment.
Thanks for the update, @PeterStaar-IBM. I reviewed a375b3f2 against base 0e542942. I found five blockers below. Six small regression checks pass on the base and fail on this head. Please fix these before merge.
Validation:
- Python 3.10.19 with the locked dependencies, including
docling-core 2.100.0. uv run --no-sync pytest -q -p no:tach tests/test_latex: 165 passed, 1 failed, 1 skipped. The failure istest_e2e_latex_conversionsfor1706.03762/main.tex. The skipped test is the opt-in arXiv corpus test.- Hosted core CI fails on the same test. The full local core suite and the streamed corpus were not run.
- Ruff, ty (with the current warning policy), Tach, skill routes, dprint, and the lock check pass.
make validatereports no changed files. make checkfails on 17 files over the line limit. The base fails on 16 of them. This PR addstests/test_latex/test_macros.pyat 1,031 lines; it has 804 lines on the base. Please split that test file too.
I also checked the earlier advisory questions. In arXiv-2501.01300v2, the removed 1, .001, and cas-model2-names come from layout definitions and the bibliography style. The removed [mode = title] is a title option. Those removals are expected. The tested bibliography link already exports the URL and title together on the base, so I did not report it as a new regression.
The reference outputs must be checked again after the fixes. The current end-to-end test stops at the first Markdown mismatch.
9c499e9
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
DanielNg0729
left a comment
There was a problem hiding this comment.
Thanks a lot Dr Peter, Looks good to me 🎉
Peter is just fine ;) PS: you might want to look into https://github.com/docling-project/docling/blob/6509f8aea79a4e065647d85413dc3ecd911823c2/tests/test_latex/test_large_scale.py I found already many source files that threw errors with it (it iterates over the dataset "secemp9/arxiv-complete"). However, it did not complete the entire dataset (only 07 and 08). I am sure many more bugs can be found this way. |
|
Thanks for the update. I rechecked The two cases from my last comment now pass. Their new regression tests both fail on the previous head, Blocker (P2): preserve command boundaries when removing comments.
\documentclass{article}
\newcommand{\brand}{Docling}
\newcommand{\term}[1]{\brand% comment
rocks #1}
\begin{document}
Important content. \term{now}
\end{document}The base exports Blocker (P2): make the default DocLang export pass the schema. Source-command retention adds invisible text items even for this input: \documentclass{article}\begin{document}Body.\end{document}The base's The corpus test already filters out this layer. The default SDK export and CLI DocLang export do not use that filter. Caption placement is fixed, and its public body-layer export validates. Please also make the default public export schema-valid, with a regression test for this simple input. Suggestion: update Validation:
I still recommend changes before merge. |
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
74f565e
|
I rechecked The two cases from my last comment now pass. The four new regression cases fail on the previous head, Blocker (P2): preserve command arguments when removing comments.
This valid input shows the defect: \documentclass{article}
\newcommand{\expression}{\sqrt% comment
x}
\begin{document}
$\expression$
\end{document}The formula item and Markdown export contain The same step changes I checked both formulas with the installed MathML converter. Two focused tests compare each commented definition with its equivalent space-separated definition. Both tests fail on this head. Please preserve the command boundary without adding an argument. Add regression tests for both cases. Keep the existing zero-argument command and Validation on Python 3.10.19 with frozen dependencies, including
I recommend changes before merge. |
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Summary
Improve the LaTeX backend for arXiv source files. The backend now keeps inline formulas as formulas in text, headings, captions, table cells, and front matter.
Added the script to do large scale scans of latex-backend on entire arxiv,
Changes
Validation
@DanielNg0729 I added a new large scale test, that allows us to iterate via streaming over many many latex files