Validate OCR output with bounding boxes
Use per-field box and quad coordinates with review.flagged and review reasons to validate OCR output without relying on a fixed confidence threshold.
Validating OCR usually means re-reading the document yourself — slow, and exactly the work you were trying to avoid. Bounding boxes change the loop: instead of comparing two columns of text, you let your eye jump to the spot on the image where each value was read from. Right or wrong becomes obvious in a glance.
The signals attached to each value
space ocr separates business data from review metadata. Extracted values live in data.values. For a field path, data.cells[path] can contain an axis-aligned box, an oriented quad, a verified verdict, a review object, and supporting evidence.
Do not build the review queue from a fixed match-ratio threshold. Start with data.review.flagged; each item's path points directly to data.cells[path], where the UI can show the location and review reasons. Match ratio may appear under evidence, but it is only one diagnostic signal.
Coordinates are evidence, not proof
The source coordinates are produced by matching extracted text against OCR observations on the page rather than asking the language model to invent geometry. That makes box, quad, and evidence.printed_text useful for checking a value at its source. It still does not guarantee correctness: two systems can agree on the same misread, and declared rules can flag a value even when its text matches. See Document OCR with an audit trail.
- Read the review queueRead data.review.flagged after POST /ocr/fields or the corresponding stored result.
- Resolve each pathUse each flagged item's path to open data.cells[path] and display its review reasons.
- Confirm by locationDraw the cell's box or quad over the frame described by data.image and compare the printed source with data.values.
- Correct and validate downstreamApply the documented edit workflow where appropriate, and keep business-rule checks for errors that OCR comparison alone cannot detect.