DEV Community

Vanrajsinh Solanki
Vanrajsinh Solanki

Posted on

How Far Can Document Grounding Go Using the Document Itself?

Extraction is only half of the problem.

A document system can tell you:

$12.4M

But a production system often needs another answer:

Where did that number come from?

I spent the last few months investigating how much of that grounding problem can be solved directly from the document.

That led to TonerHound.

The approach uses PDF structure, character coordinates, OCR, geometry, matching, table relationships and visual page evidence.

The current benchmark result is 72.6179% Word Grounding F1.

The more interesting result, however, was understanding the failures that remained.

This article walks through what worked, what failed, and where document-native grounding starts to hit harder problems.

Top comments (1)

Collapse
 
ahmetozel profile image
Ahmet Özel •

The combination of character coordinates and visual page evidence makes coordinate normalization an important part of the grounding contract. A correct match can still produce a misleading highlight if PDF rotation, crop boxes or the OCR image scale are interpreted differently by the extractor and the viewer. I would test those transforms independently with known page locations.

For the remaining failures, separating wrong text matches from correct text attached to the wrong region would help interpret the Word Grounding F1. Those errors require different fixes: better matching for the first, geometry or rendering corrections for the second. A breakdown by scanned pages, rotated pages and repeated values could make the aggregate score much more actionable.