Launch document preprocessing
Launch document preprocessing
datasets.launch_preprocessing(strdataset_id, DatasetLaunchPreprocessingParams**kwargs) -> DatasetLaunchPreprocessingResponse
POST/api/v1/datasets/{dataset_id}/launch-preprocessing
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.
Parameters
Launch document preprocessing
import os
from adaption import Adaption
client = Adaption(
api_key=os.environ.get("ADAPTION_API_KEY"), # This is the default and can be omitted
)
response = client.datasets.launch_preprocessing(
dataset_id="dataset_id",
)
print(response.dataset_id){
"dataset_id": "dataset_id",
"status": "pending",
"credits_escrowed": 0,
"pages_to_process": 0,
"documents_selected": 0,
"documents_total": 0
}Returns Examples
{
"dataset_id": "dataset_id",
"status": "pending",
"credits_escrowed": 0,
"pages_to_process": 0,
"documents_selected": 0,
"documents_total": 0
}