Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Mistralai Client python OCR Result Processing

From Leeroopedia
Knowledge Sources
Domains Document_Processing, OCR
Last Updated 2026-02-15 14:00 GMT

Overview

A response extraction pattern that navigates OCR response structures to retrieve per-page text, tables, images, and document annotations.

Description

OCR Result Processing extracts structured content from the OCRResponse object. The response contains a pages list where each OCRPageObject has markdown (extracted text), images (extracted image objects with optional base64 data), tables (structured table data), and dimensions (page width/height). An optional document_annotation field at the top level contains structured extraction results.

Usage

Use this principle after calling client.ocr.process() to extract and process document content. Iterate over response.pages to access per-page results.

Theoretical Basis

OCR response hierarchical structure:

  • OCRResponse → top-level container
    • pages: List of per-page results
      • markdown: Full text content as markdown
      • images: Extracted images with IDs and optional base64 data
      • tables: Structured table objects
      • dimensions: Page width and height
    • usage_info: Token consumption
    • document_annotation: Optional structured extraction

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment