Document Parsing
Cohere’s Parse model converts unstructured enterprise documents (PDFs, images, slides) into structured Markdown output. It extracts text, tables, lists, forms, images, captions, and bounding box coordinates.
This quickstart guide shows you how to parse a document image with the Parse endpoint.
Setup
First, install the Cohere Python SDK with the following command.
Next, import the library and create a client.
Cohere Platform
Private Deployment
SageMaker
PYTHON
Prepare the Document
Parse accepts documents as base64-encoded data URIs. Convert your image to a data URI.
PYTHON
Parse the Document
Pass the document to the Parse endpoint. By default, the response contains Markdown output.
Cohere Platform
Private Deployment
SageMaker
PYTHON
Blocks Output
To get structured content blocks, set output_format to "blocks". Each block has a type (e.g. text, table) with type-specific fields including bounding boxes for tables.
PYTHON