Dataset

Launch document preprocessing

Changed on

Extracts the text, tables and figures of an uploaded document dataset (pdf, docx, pptx, xlsx, html, or a zip of them) into rows. After the upload completes, such a dataset reports awaiting_input until this is called. Reserves credits from the page count of the selected documents — quote them first with GET /datasets/{dataset_id}/preprocessing-credits — then starts extraction. Poll GET /datasets/{dataset_id}/status: it reports pending while extracting and awaiting_input once the rows are ready, at which point call POST /datasets/{dataset_id}/adapt.

post/api/v1/datasets/{dataset_id}/launch-preprocessing

Request

Path parameters

dataset_idstring required

Request body

pages_to_processnumber

Maximum number of pages to process. Documents are included until this budget is reached. If omitted, all pages are processed.

documents_to_processnumber

Maximum number of documents to process. If omitted, all documents are processed.

preprocessing_mode'per_document' | 'per_page'

How extracted content becomes rows: per_document (default) makes one row per document, per_page one row per page. Omit to keep the mode already set on the dataset.

Example request

{
  "preprocessing_mode": "per_document"
}

Response

dataset_idstring required

ID of the dataset

statusstring required

Dataset status after the launch. Poll GET /datasets/{dataset_id}/status until it reports awaiting_input, then call POST /datasets/{dataset_id}/adapt.

credits_escrowednumber

Credits reserved for extracting the selected documents

pages_to_processnumber

Total pages across the documents selected for extraction

documents_selectednumber

Number of documents selected for extraction

documents_totalnumber

Number of documents in the dataset

Example response

{
  "status": "pending"
}

Changes