Skip to content

start_import_labels_task_run

start_import_labels_task_run(
    transform_id: HashString,
    input_s3_path: UriString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    replace_all_labels: Optional[ReplaceBoolean] = None,
) -> StartImportLabelsTaskRunResponse

Enables you to provide additional labels (examples of truth) to be used to teach the machine learning transform and improve its quality. This API operation is generally used as part of the active learning workflow that starts with the StartMLLabelingSetGenerationTaskRun call and that ultimately results in improving the quality of your machine learning transform.

After the StartMLLabelingSetGenerationTaskRun finishes, Glue machine learning will have generated a series of questions for humans to answer. (Answering these questions is often called 'labeling' in the machine learning workflows). In the case of the FindMatches transform, these questions are of the form, “What is the correct way to group these rows together into groups composed entirely of matching records?” After the labeling process is finished, users upload their answers/labels with a call to StartImportLabelsTaskRun. After StartImportLabelsTaskRun finishes, all future runs of the machine learning transform use the new and improved labels and perform a higher-quality transformation.

By default, StartMLLabelingSetGenerationTaskRun continually learns from and combines all labels that you upload unless you set Replace to true. If you set Replace to true, StartImportLabelsTaskRun deletes and forgets all previously uploaded labels and learns only from the exact set that you upload. Replacing labels can be helpful if you realize that you previously uploaded incorrect labels, and you believe that they are having a negative effect on your transform quality.

You can check on the status of your task run by calling the GetMLTaskRun operation.

Parameters:

  • transform_id (HashString) –

    The unique identifier of the machine learning transform.

  • input_s3_path (UriString) –

    The Amazon Simple Storage Service (Amazon S3) path from where you import the labels.

  • replace_all_labels (Optional[ReplaceBoolean], default: None ) –

    Indicates whether to overwrite your existing labels.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def start_import_labels_task_run(
    self,
    transform_id: "capo_glue.types.hash_string.HashString",
    input_s3_path: "capo_glue.types.uri_string.UriString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    replace_all_labels: Optional[
        "capo_glue.types.replace_boolean.ReplaceBoolean"
    ] = None,
) -> "capo_glue.types.start_import_labels_task_run_response.StartImportLabelsTaskRunResponse":
    """<p>Enables you to provide additional labels (examples of truth) to be used to teach the machine learning transform and improve its quality. This API operation is generally used as part of the active learning workflow that starts with the <code>StartMLLabelingSetGenerationTaskRun</code> call and that ultimately results in improving the quality of your machine learning transform. </p> <p>After the <code>StartMLLabelingSetGenerationTaskRun</code> finishes, Glue machine learning will have generated a series of questions for humans to answer. (Answering these questions is often called 'labeling' in the machine learning workflows). In the case of the <code>FindMatches</code> transform, these questions are of the form, “What is the correct way to group these rows together into groups composed entirely of matching records?” After the labeling process is finished, users upload their answers/labels with a call to <code>StartImportLabelsTaskRun</code>. After <code>StartImportLabelsTaskRun</code> finishes, all future runs of the machine learning transform use the new and improved labels and perform a higher-quality transformation.</p> <p>By default, <code>StartMLLabelingSetGenerationTaskRun</code> continually learns from and combines all labels that you upload unless you set <code>Replace</code> to true. If you set <code>Replace</code> to true, <code>StartImportLabelsTaskRun</code> deletes and forgets all previously uploaded labels and learns only from the exact set that you upload. Replacing labels can be helpful if you realize that you previously uploaded incorrect labels, and you believe that they are having a negative effect on your transform quality.</p> <p>You can check on the status of your task run by calling the <code>GetMLTaskRun</code> operation. </p>

    Args:
        transform_id: <p>The unique identifier of the machine learning transform.</p>
        input_s3_path: <p>The Amazon Simple Storage Service (Amazon S3) path from where you import the labels.</p>
        replace_all_labels: <p>Indicates whether to overwrite your existing labels.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.start_import_labels_task_run_request.StartImportLabelsTaskRunRequest]",
    ) -> OperationResponse[
        "capo_glue.types.start_import_labels_task_run_response.StartImportLabelsTaskRunResponse"
    ]:
        import capo_glue._operations.aws_glue.start_import_labels_task_run

        output, http_response = (
            capo_glue._operations.aws_glue.start_import_labels_task_run.start_import_labels_task_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartImportLabelsTaskRun")
    )
    input_: capo_glue.types.start_import_labels_task_run_request.StartImportLabelsTaskRunRequest = {
        "transform_id": transform_id,
        "input_s3_path": input_s3_path,
    }
    if replace_all_labels is not None:
        input_["replace_all_labels"] = replace_all_labels

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output