Repository navigation
fix: normalize Nemotron formula delimiters before export - #4907
PierreMesure wants to merge 1 commit into
Conversation
Use a shared LaTeX delimiter normalizer and keep the raw response in orig. Verify all delimiter styles and multiline equations. Fixes docling-project#4903. Signed-off-by: Pierre Mesure <pierre@mesu.re>
|
✅ DCO Check Passed Thanks @PierreMesure, 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 The PR adds Topic labels added: CI safety: needs maintainer care before you approve CI.
2 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 3bc0ecc63b. It read the code and did not run it.
The PR adds strip_math_delimiters in vlm_utils.py and calls it for FORMULA items in nemotron_parse_utils.py. The fix is correct, the delimiter priority order ($$ before $) is safe, the orig field keeps the raw text, and the regression tests cover all four delimiter styles plus multiline. The tach.toml dependency addition is accurate and introduces no cycle. No blockers found.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Nemotron formula responses such as
\(x^2\)exported as$$\(x^2\)$$. Store the LaTeX body without its matching outer delimiters so the serializer supplies exactly one pair. Keep the original response inorigand preserve escapes, line breaks, and coordinates.The normalizer is in shared VLM utilities. LightOnOCR PR #4789 now uses the same helper; the helper is identical in both branches.
Resolves #4903.
Checklist:
Review evidence:
.venv/bin/python -m pytest -q tests/test_nemotron_formula_exports.py tests/test_nemotron_parse_v2.py: 14 passed on Python 3.12.UV_NO_SYNC=1 make validate: all applicable hooks passed.