For the complete documentation index, see llms.txt. This page is also available as Markdown.

OCR Result

Reference documentation on processing an OCR result using the Mindee SDKs.

You'll need to have a response object as described in the Response Processing section.

Accessing the Page OCR

An OCRPage describes the text and words of a single page in the document.

OCRPage Attributes

Content

Full text content extracted from the document page.

Words

List of all words found on the page.

Each word has the following properties:

  • Content: Text content of the word.

  • Polygon: Coordinates of the detected word.

from mindee import OCRResponse

def handle_response(response: OCRResponse) -> None:
    pages = response.inference.result.pages

    for page in pages:
        # Page-level properties
        page_content = page.content
        words = page.words

        # Access the full text content extracted from this page.
        print(f"Page content: {page_content}")

        # Access all words detected on this page.
        for word in words:
            word_content = word.content
            word_polygon = word.polygon

            print(f"Word: {word_content}")
            print(f"Polygon: {word_polygon}")

Last updated

Was this helpful?