# How do you evaluate OCR when table rows must stay aligned?

> Evaluate table OCR with cell values, row and column associations, missing records and review effort, not character accuracy alone.

Source: https://www.nodus-compute.ai/blog/evaluate-table-ocr-row-alignment/
Build revision: 4480882d5ec4d6f851964dedc9c8da3c3c838584

**Evaluate table OCR against complete records, not just recognized text. Check that each value belongs to the right row, column, header and unit. Count missing and invented records as well as incorrect characters, then measure how much human review the result requires.**

Nodus can run your own compatible document-evaluation programs as Jobs, show their progress and let you retrieve saved reports. You define the OCR system and the acceptance test. Successful compute execution does not establish that an extracted table is correct.

A table can contain all the right words and still be unusable. If two line-item amounts exchange rows, a text-only comparison may see no missing words while the purchasing record is wrong.

## What does a correct record mean?

Begin with the action that follows extraction. A searchable archive may tolerate imperfect table reconstruction. Importing invoice lines into a purchasing system requires the right description, quantity, unit price and amount to remain associated. Comparing experimental results may depend on a column’s unit and a header spanning several subcolumns.

Define those relationships before choosing a score. For a line-item task, a correct record might require an accepted item identifier, quantity and amount together. Treat a value in the wrong row as an association error, even when its characters are recognized perfectly.

Specify acceptable formatting differences without erasing meaning. Whitespace changes may be harmless. Losing a minus sign, decimal separator, currency or unit is not necessarily harmless. A blank cell, an explicit zero and an unreadable value should remain distinguishable unless the task genuinely treats them alike.

## Separate reading text from reconstructing the table

Keep several views of quality. Text recognition asks whether the characters are right. Table reconstruction asks whether the cells, rows, columns and spanning headers are represented correctly. Record correctness asks whether the information needed for the next action survives together.

These views explain different failures. A missing row is not merely a few character mistakes. A merged cell split into separate rows can create apparent records that never existed. A table continued on another page can gain a repeated header mistaken for a new item.

For each reference record, check that the expected output appears once with its required relationships intact. Also inspect extracted records that match nothing in the reference. Reporting only how many expected records were found misses duplicate and invented rows.

When repeated item names occur, do not match rows using whichever amount makes the result look best. Establish an unambiguous reference identity or a documented matching policy before evaluating candidates. Preserve genuine uncertainty for review.

## Build references from the original documents

Have reviewers inspect the original page, not only a previous OCR export. Otherwise the reference may inherit the very row shift you want to detect. Preserve access to the page region that establishes each disputed record.

Include the document conditions you expect: dense rows, wrapped descriptions, faint scans, borderless tables, rotated pages, merged headers and tables continuing across pages. Separate representative samples from deliberately difficult diagnostic cases. A stress test is useful without pretending its failure frequency represents normal incoming documents.

Split evaluation material by document family or template where appropriate. Near-identical pages from one layout appearing on both sides of a comparison can hide weak performance on an unfamiliar form. If repeat templates are part of the real use case, report known-template and new-template results separately rather than silently choosing one.

Resolve reviewer disagreements or mark the reference uncertain. Do not force an answer when the source itself is illegible. Report the count and handling of those cases so excluding them does not quietly inflate quality.

## Worked example: perfect characters, incorrect records

The following example is fictional and illustrative. It is not a Nodus result or a claim about any OCR product. Assume a small reference table has these three line items:

|Item|Quantity|Amount|
|-|-|-|
|A|2|40|
|B|1|70|
|C|3|90|

Suppose an extraction preserves every displayed character and every quantity, but assigns the amounts 70, 40 and 90 to A, B and C respectively. The amounts for A and B have exchanged places. The extracted amount total is still 200, exactly the reference total.

A comparison that ignores order and checks only which text values appear can pass. A total check can pass too. But only C has the complete correct record. Under the stated requirement that item, quantity and amount must match together, complete-record correctness is one of three, about 33%.

This is not a claim that every character-error metric would miss the swap. A comparison that respects reading order may penalize it. The point is narrower: text inventory and totals cannot prove correct row association. Test that association directly rather than hoping another score will reveal it.

Now suppose another extraction gets all associations right but omits C entirely. Its two returned records are correct, yet it recovered only two of the three expected records. Report both the correctness of returned records and coverage of expected records. A clean-looking partial table is not a complete extraction.

## Measure failures that affect the next step

Report missing, extra, duplicated, misassociated and unreadable records separately. Within otherwise matched records, identify errors in critical fields such as signs, amounts and units. Do not let an improvement on long descriptions hide a regression in the fields that determine a payment or experimental conclusion.

Track complete-table success as well as record-level results when the next step requires every row. Averages over many easy cells can conceal a small set of unusable documents. Break out results by layout, source quality and document family, and show the denominators.

Use arithmetic checks as alarms, not proof. A quantity-times-price mismatch may flag an error, but a matching total does not certify the table, as the illustrative swap shows. Real documents can also contain discounts, rounding or source mistakes. Inspect the original rather than rewriting values until arithmetic agrees.

## Compare usable output and review effort

Give every candidate system the same documents and acceptance rules. Evaluate the full path from source page to usable records, including any human correction that is part of the proposed process. A fast recognition step is not the same as fast completion of an accurate import.

Measure review effort alongside quality: which documents need inspection, how long correction takes and whether important errors reach the next step unnoticed. Treat confidence as a signal to validate, not a guarantee that low-confidence cases contain all the mistakes.

Set the acceptance decision before seeing a preferred system’s score. You may allow automatic handling for a well-tested document family while routing unfamiliar layouts or disputed values to review. Keep a final held-out set so repeated tuning against known failures does not become the only evidence of readiness.

## Where does Nodus fit?

Nodus supports executing your own evaluation program and collecting its saved reports. The public [Jobs guide](https://www.nodus-compute.ai/docs/guides/jobs/) explains running and monitoring programs; the [outputs guide](https://www.nodus-compute.ai/docs/guides/outputs/) explains retrieving results. Keep the original documents, reviewed references and comparison reports under your own appropriate access controls.

This is execution support, not a managed OCR service or a promise of extraction accuracy. You remain responsible for model compatibility, document permissions, reference quality and the acceptance decision. To discuss running your document evaluation on Nodus, [book a conversation](https://nodus-compute.ai/book/).

## FAQ

### Is character accuracy useless for tables?

No. It helps identify text-recognition errors. It is insufficient by itself when correct use depends on row, column or header relationships.

### Should every cell have equal weight?

Not necessarily. Report ordinary recognition quality, but evaluate required records and critical fields explicitly. Define their importance from the downstream task, not from whichever weighting makes a candidate win.

### Does a correct total mean the extraction is safe to import?

No. Swapped values can preserve a total, missing and extra rows can offset each other, and the original document may contain an error. Validate the records and their associations against the source.
