Add pymupdf4llm_html_tables pipeline (thread table_output=html through the provider)#1
Open
veget-able wants to merge 2 commits into
Open
Conversation
Read an optional `table_output` config key in `_markdown_options` and
pass it to `pymupdf4llm.to_markdown`. This is the opt-in switch for the
native HTML table engine: builds that ship it render structured <table>
markup for `table_output="html"`, while builds without it ignore the
extra keyword, so the existing pymupdf4llm_markdown* pipelines are byte
-for-byte unchanged (no config sets the key).
The kwarg is what makes the pymupdf/pymupdf4llm table work measurable on
ParseBench: with the HTML engine inactive the layout path emits the same
markdown pipe-tables as the baseline (table score ~56.73 GTRM); with it
active the reconstructed HTML tables lift the table score to ~72.11.
Validated to {"markdown","html"} to fail fast on typos, matching the
provider's other option checks.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Register a pymupdf4llm PARSE pipeline that sets `table_output="html"`, so the native HTML table engine is exercised end-to-end on the benchmark. It reuses the existing pymupdf4llm provider (same OCR/layout defaults as `pymupdf4llm_markdown`) and only flips table rendering to HTML. Naming follows the pymupdf4llm_markdown* family; table rendering is an orthogonal knob to the OCR-backend variants, hence the distinct suffix. Run against a pymupdf4llm build with the HTML table engine: uv run parse-bench run pymupdf4llm_html_tables --max_concurrent 1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR targets the upcoming improved PyMuPDF / PyMuPDF4LLM builds, not stock 1.28.0.
With the current stock wheels the
table_outputkeyword is accepted and ignored, so thispipeline produces the same output as
pymupdf4llm_markdowntoday. It is sent ahead of theimprovement release so the benchmark wiring is already in place when the new builds land -
the 72.11 GTRM below was measured against those improved builds.
Summary
Adds a one-keyword passthrough so the pymupdf4llm PARSE provider can request the
native HTML table engine, plus a
pymupdf4llm_html_tablespipeline that turns iton. This is what makes the pymupdf/pymupdf4llm table work measurable on ParseBench.
Two small commits, 3 files, +43 lines:
_markdown_options()reads an optionaltable_outputconfig key (validated to{"markdown","html"}) and forwards it topymupdf4llm.to_markdown.pymupdf4llm_html_tables= the existing pymupdf4llm provider withconfig={"table_output": "html"}(same OCR/layout defaults aspymupdf4llm_markdown,only the table rendering flips to HTML).
Why
The improved pymupdf4llm build renders reconstructed HTML tables only when
to_markdown(..., table_output="html")is passed — it is opt-in. Without thispassthrough the layout path emits the same markdown pipe-tables as the stock build,
so the benchmark cannot see the table work at all:
table_output="html"wired (this PR)<table>Tables group: GTRM = GriTS + TableRecordMatch, 503 pages / 284 docs. The 72.11 was
verified end-to-end through this exact branch + pipeline (
pymupdf4llm_html_tables,--max_concurrent 1, 503/503 success) against the improved pymupdf/pymupdf4llm builds.Compatibility
pipeline explicitly sets
table_outputin its config; none of the currentpymupdf4llm_markdown*pipelines do. Verified:_markdown_optionsfor the baselineemits no
table_outputkey.import (
_use_layout=True), which this provider already relies on forpage_boxes,so
table_output="html"lands on the preferred layout+HTML path with no extra import.markdown pipe-table output, no error), so the pipeline degrades gracefully when the
HTML table engine is not present.
How to run
Not included (deliberately minimal)
use_tgifenv toggle — it is a no-op in current stacks and this provider doesnot read it.
LAYOUT_DETECTION(to_json) provider — that's a separate benchmarktask from the PARSE table quality this PR targets.
leaderboard.csvrow yet — can add one after a scored run in the canonicalenvironment.
Companion analysis of the underlying table engine (PyMuPDF
table.py+ pymupdf4llm,GTRM measurements, TableFinder/TableHunter comparison) is available on request.