Principle:Mistralai Client python OCR Result Processing
| 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
- pages: List of per-page results