﻿# Label Studio OCR predictions: join a text result to the region it transcribes

Construct Label Studio OCR pre-annotations with region-linked geometry and transcription results instead of pairing text and boxes by array position.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-label-studio-ocr-region-result-identity/
Language: en

## Recognize the composite annotation

An OCR annotation often needs both a region and the text read from that region. These components can appear in separate result entries rather than one convenient box-and-string record. The [Label Studio prediction guide](https://labelstud.io/guide/predictions) provides an OCR pre-annotation example with shared region identifiers. Treat the link as part of the data contract. Matching the first text entry to the first rectangle is fragile when controls produce different result orderings.

## Match each control to its role

A geometry result identifies the labeling control and target object used by the project. A transcription result must reference its own text control. The [TextArea reference](https://labelstud.io/tags/textarea) describes text values and region-oriented configuration. Copying all geometry fields into the text entry does not establish that the transcription belongs to the right region. Inspect the project's actual control names, result types and target bindings before generating an import file.

## Preserve geometry in its native coordinates

The [RectangleLabels reference](https://labelstud.io/tags/rectanglelabels) describes rectangle values and original image dimensions. Keep geometry conversion separate from region linkage. A perfectly linked text string can still be attached to a misplaced box after resizing or rotation. Use a pilot containing adjacent text regions and differing reading order, then inspect both the region boundaries and the displayed transcription in the labeling interface before importing a large OCR prediction set.

## Carry the relationship into downstream data

When exporting OCR supervision, preserve the source image and region identity alongside the geometry and transcription. Sorting either results array can change order without changing region meaning. Joining by a stable region relationship makes that transformation explicit and allows later corrections to update the appropriate text. Retain a policy for empty or unreadable text rather than inventing a transcription merely to keep every geometry entry paired with a nonempty string.

## Inspect the difficult cases

Review neighboring regions, repeated text and a region whose geometry is corrected after import. Confirm that editing or reordering does not silently reassign the transcription. The guides on [document entity relationships](/journal/data-guide-funsd-form-entity-relations/) and [image-coordinate transformations](/journal/data-guide-image-exif-box-coordinate/) explain related dataset mechanics. Correct OCR preparation requires both a valid spatial representation and a reliable association between that representation and the text being judged; neither condition can be inferred solely from a successful JSON import.
