Here is a test your document parser can pass on every page and still fail.Take a six-page bank statement with one table of 222 transactions that runs from page 1 to page 5. Many parsers return it in pieces. Each piece looks right on its own page, so a benchmark that scores one page at a time can give it good marks. But the code that adds up the transactions now gets several tables, and the pieces can carry repeated header rows or page footers between them.Nothing throws an error. You find out when a total doesn't match.In this article, I show the errors that only exist between pages, how to score them with plain code instead of an AI judge, what we saw when we ran 13 parsers in 19 settings on them, and a checklist you can use to test your own parser on your own documents. The short version of the results: the parser with the top score costs about a tenth as much per page as the best frontier model.First, a disclosure. I work at Nutrient, which makes a document parsing API. I worked on the launch of WholeDoc Bench, the benchmark I describe here. Nutrient built it, and our parser has the top overall score on it. That is why the scoring code is open source under Apache 2.0: you can check every rule below yourself.A six-page bank statement with one table of 222 transactions. Each page looks right on its own; the document comes back as several tables.Why page-level scores miss these errorsA PDF doesn't store tables or paragraphs. It stores characters and lines at positions on a page. A parser has to rebuild the structure, and it usually does that one page at a time, because that is how layout and vision models look at a document.Most parsing benchmarks work the same way. olmOCR-Bench, for example, tests models on single PDF pages, and OmniDocBench scores single pages too. A page-level score can't tell you whether the table on page 2 continues the table on page 1.The authors of READoc put it directly: "Benchmarks focusing on isolated pages or blocks fail to provide realistic evaluations." WholeDoc Bench scores whole documents, and it also tests the opposite case, where two blocks on two pages look connected but must stay apart. We haven't found another benchmark that checks both directions.Four errors that only exist between pagesFour of them come up again and again:A table that continues becomes several tables. The five-page table comes back as five tables. As one HackerNoon author writes about RAG ingestion, "A table cut in half is worse than a table that is slightly too long."A repeated header becomes data. Many documents print the column header at the top of every page. If the parser keeps them, your table gets rows that say "Date | Description | Amount" in the middle of the transactions.Page furniture lands inside the content. A sentence that runs from page 3 to page 4 comes back with "Page 3 of 4" or a running header in the middle of it.Two blocks get joined that must stay apart. A paragraph ends at the bottom of page 1, and a new one starts at the top of page 2. A parser that joins text at every break merges them into one.Here is a simplified example of the first three in one output:| Date | Description | Amount | |------------|------------------|----------| | 2026-03-01 | Opening balance | 1,204.50 | | 2026-03-02 | Card payment | -42.10 | Page 1 of 6 · Account 0042-1187 | Date | Description | Amount | |------------|------------------|----------| | Date | Description | Amount | | 2026-03-03 | Transfer in | 500.00 | Errors 3 and 4 pull in opposite directions. A parser that always joins text across a page break fixes error 3 and causes error 4. That is why a benchmark has to test both.Four errors that only exist between pages. How to score these errors with codeWholeDoc Bench scores seven areas: text, reading order, structure, tables, barcodes, charts and the position of each item on the page. Here I only cover the checks at page breaks. Every check is plain Python: string matching, edit distance and tree edit distance. No model grades the output, so the same output always gets the same score.Step 1: Mark the breaks in the answer keyEach answer key lists the elements of the document, page by page. Where content crosses a page break, the key adds a relation between the two pieces: continues_in when the second piece continues the first, and stays_apart when the two only look connected. A table that runs across five pages is five table pieces, linked by continues_in.{"kind": "continues_in", "from": "p3-para-7", "to": "p4-para-1"} {"kind": "stays_apart", "from": "p1-para-9", "to": "p2-para-1"} The IDs here are simplified. Parsers can return the same kind of relation in their own output, which matters for the table check below.Step 2: One output table for each real tableThe table check is strict. In simplified form, the scorer's rules are:The scorer joins the pieces of the real table into one table to compare the output against.An output row counts as a match for a real row when at least half of the real row's filled cells appear in it, in the same columns.An output table covers a piece when it holds at least half of that piece's rows.An output table counts as a match only if it covers every piece of the real table and doesn't also contain another real table.The score is F1: precision is matches divided by output tables, and recall is matches divided by real tables.def table_integrity(real_tables, output_tables): pairs = [(out, real) for out in output_tables for real in real_tables if covers_every_piece(out, real) and not holds_another_table(out, real_tables, real)] matches = one_to_one(pairs) # best fit first if not matches: return 0.0 precision = len(matches) / len(output_tables) recall = len(matches) / len(real_tables) return 2 * precision * recall / (precision + recall) So five separate pieces in the output score zero for that table, even if every cell is right. Two different tables merged into one also score zero. If a parser returns the pieces separately but links them with a continues_in relation, the scorer counts them as one table for this check.The tables area also uses TEDS, the tree-edit-distance score from table recognition research, to grade the cells themselves. On a single page, each piece of a split table can get a high TEDS score. Table integrity checks what a page-level score can't: whether the pieces were put back together.Step 3: Check the rows right after each breakA table can also come back in one piece, with the columns shifted by one after page 2. To catch that, the scorer checks the first three rows after each page break. Each cell with unique text must sit under the corresponding column header, to the left of the right neighbour and below the correct cell above it. For two tables that meet at a page break but must stay apart, it checks that they come back as two separate tables.Step 4: Check text across breaks in both directionsFor each continues_in link, the check passes only if all of these are true:Both halves are in the same output block, in the right order.No text from another block is merged in.No header, footer, page number, caption, footnote or heading from those two pages is inside the joined block.The text doesn't appear twice.For each stays_apart link, the check fails if both halves end up in the same block. When a check fails, the scorer writes down why:{"kind": "continues_in", "from": "p3-para-7", "to": "p4-para-1", "passed": false, "reasons": ["extra_source_text"]} Here, extra_source_text means that text such as a page number ended up inside the sentence. Other reasons are split, merged, misplaced_break, missing and duplicate.The score is the average of two pass rates: one for continues_in and one for stays_apart. Join everything, and a parser passes the first and fails the second. Never join, and it does the opposite. Passing both requires telling the two cases apart.What we saw across 13 parsersWe ran 13 parsers in 19 settings, from document APIs and frontier models to open-source tools, on a private set of business documents: statements, invoices, delivery notes and reports like the ones our customers send us, both born-digital and scanned. A setting is one parser run in one mode or at one effort level. For example, Nutrient's Agentic, Understand and Structure modes count as three settings. The numbers below are from the run of November 5, 2026.Accuracy against cost. Nutrient's Agentic mode scored 86.1 out of 100 at 1.8¢ per page, and Understand scored 80.8 at 0.9¢. The best frontier model scored 67.1 at about 18¢, ten times the price of Agentic. Frontier models get one page per request, so the test gives them help: when a page ends with a paragraph, list item or table, the next request quotes it, so the model can mark what continues. On this set, the most expensive parsers didn't score highest.Overall score against list price per page for the 15 settings with a list price, WholeDoc Bench run of November 5, 2026. The line joins the best score you can get at or below each price. Full names are on the leaderboard. Overall score against list price per page for the 15 settings with a list price, WholeDoc Bench run of November 5, 2026. The line joins the best score you can get at or below each price. Full names are on the leaderboard.What happens at page breaksTables that cross pages. When a table continues across a page break, two Nutrient modes returned it as one table almost every time. 15 of the 19 settings returned it as one table in fewer than one case in five.Repeated headers. In a five-page invoice with 183 items, the column header repeats on four pages, and the right output keeps it once. Nutrient returned one table with one header. 15 of the 19 settings split the table instead.Text that crosses pages. In a scanned report, one sentence runs from page 3 to page 4, and at another break two paragraphs must stay apart. Only two of the 19 settings got both right, and both were Nutrient modes.How we keep the results fairOpen code and settings. The code, every parser setting and a sample of the documents are public, so anyone can check the results.Checked by a person. AI models from three other companies draft each answer key, and a person checks and approves every one.The main test set stays private, so that nobody can train on it. A sample of 10 documents (28 pages) is public.Dated results. Parsers change, so every result carries the date of its run.Run it on your own parserThe code is on GitHub, and the public sample is on Hugging Face. You need uv and, for this example, pdftotext from Poppler:git clone https://github.com/PSPDFKit-labs/wholedoc-bench && cd wholedoc-bench uv sync # Download the public sample, pinned to its tag uvx --from huggingface_hub hf download nutrientdocs/wholedoc-bench-sample \ --repo-type dataset --revision v1 --local-dir wholedoc-bench-sample # Run a parser, score it, build the report uv run wholedoc-bench run --provider pdftotext --corpus wholedoc-bench-sample --out runs/pdftotext uv run wholedoc-bench score --corpus wholedoc-bench-sample --predictions runs/pdftotext --results results uv run wholedoc-bench report --results results pdftotext reads only the text layer, so it returns nothing for 3 of the 4 scans in the sample. The report marks it FAIL on the coverage gate, which requires a valid result for at least 95% of the documents. That makes it a useful first run: you see what a failure looks like.To score a parser that has no adapter yet, write one JSON file per document with its Markdown output (markdown is the only required field; layout and relations are optional), add a short claims file with the parser's name, version and settings, and import it:uv run wholedoc-bench import --corpus wholedoc-bench-sample --predictions my-outputs \ --out imports/my-parser --name my-parser --claims claims.json uv run wholedoc-bench score --corpus wholedoc-bench-sample --predictions imports/my-parser --results results uv run wholedoc-bench report --results results Your row shows up in your report, marked "(imported)". The method behind every area is in the paper.A checklist for your own documentsYou can also run these checks by hand on your own pipeline. GitHub stars, as in this list of 138 open-source OCR and PDF parsers, show how popular a parser is, not how it handles page breaks. To see that, take 10 multi-page documents from your real data, with tables and paragraphs that cross pages, and check:Table count. Does the output have as many tables as the document?Repeated headers. Search the table rows for the header text. A header that appears again after the first row is a bug.Page furniture. Search paragraphs and tables for page numbers, running headers and footers.Rows after each break. Are the first three rows after each page break in the right columns?Blocks that must stay apart. Find a place where one paragraph ends at a page break and a new one starts. Did they stay apart?Totals. Add up a numeric column and compare it with the total printed in the document.If your parser passes all six on your own documents, it will probably do well on whole documents in general. If it fails one, you know where to look before your users do.The full leaderboard, with every parser and setting by name and the price of each, is on the WholeDoc Bench page. Have a question about a rule? Open an issue. Want to add a parser or a setting? Open a pull request, and we'll run it.
Scoring Document Parsers on Whole Documents, Not Single Pages
Full Article
Original Source
Read the full article at Hackernoon →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.