generate_labels_for_dataset_file

DatasetsApi.generate_labels_for_dataset_file(id, role_id, generate_labels_input_body, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Generate labels for dataset files

Starts AI label generation for up to 10 files in an unstructured (S3) dataset that is active and fully registered. Requires editor access. Runs in the background - poll the GET operation for results. Files must already be loaded and end in a lowercase .pdf or .txt. A file is only rejected when labelling has already completed for it, so one that failed or is still running can be resubmitted.

Parameters:
  • id (str) – Dataset id. (required)

  • role_id (str) – User role id (required)

  • generate_labels_input_body (GenerateLabelsInputBody) – (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

GenerateLabelsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /datasets/{id}/files/labels

Success (HTTP 200)

Successful API response

Request / response example

{
  "Message": "Successfully triggered AI operation: 'labels' on the dataset."
}

Errors

Documented error codes: IPV-1020, DS-1040, AUTH-1011.

HTTP 400

Missing required request parameters

HTTP 500

Something went wrong at backend. Input, permission and file-state errors - such as an unsupported file type, a file that is already processed, or a dataset you cannot access - are also reported here.

Files list empty

{
  "Message": "IPV-1020 - Input parameter 'Files' should not be empty."
}

More than the per-request cap

{
  "Message": "IPV-1020 - Input parameter 'Files' should not contain more than 10 files."
}

File is not a successfully loaded dataset file

{
  "Message": "IPV-1020 - Input file sales/monthly_orders/upload_date=1785146328/jdoe_b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f_1785146328_quarterly_report.pdf not found in the list of successfully loaded files in the Dataset."
}

File is not a .pdf or .txt

{
  "Message": "IPV-1020 - Input file sales/monthly_orders/upload_date=1785146328/jdoe_data.csv is not a text or pdf file."
}

Labelling already completed for the file

{
  "Message": "IPV-1020 - Input file sales/monthly_orders/upload_date=1785146328/jdoe_b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f_1785146328_quarterly_report.pdf is already labelled."
}

Dataset is not an S3 target

{
  "Message": "DS-1040 - Data labelling is not supported yet for structured Datasets."
}

Caller cannot view the dataset

{
  "Message": "AUTH-1011 - User jdoe is not authorized to view resource details"
}