Skip to content

stop_training_entity_recognizer async

stop_training_entity_recognizer(
    entity_recognizer_arn: EntityRecognizerArn,
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> StopTrainingEntityRecognizerResponse

Stops an entity recognizer training job while in progress.

If the training job state is TRAINING, the job is marked for termination and put into the STOP_REQUESTED state. If the training job completes before it can be stopped, it is put into the TRAINED; otherwise the training job is stopped and putted into the STOPPED state and the service sends back an HTTP 200 response with an empty HTTP body.

Parameters:

  • entity_recognizer_arn (EntityRecognizerArn) –

    The Amazon Resource Name (ARN) that identifies the entity recognizer currently being trained.

Raises:

Source code in docs_src/capo_comprehend/_services/async_comprehend.py
async def stop_training_entity_recognizer(
    self,
    entity_recognizer_arn: "capo_comprehend.types.entity_recognizer_arn.EntityRecognizerArn",
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> "capo_comprehend.types.stop_training_entity_recognizer_response.StopTrainingEntityRecognizerResponse":
    """<p>Stops an entity recognizer training job while in progress.</p> <p>If the training job state is <code>TRAINING</code>, the job is marked for termination and put into the <code>STOP_REQUESTED</code> state. If the training job completes before it can be stopped, it is put into the <code>TRAINED</code>; otherwise the training job is stopped and putted into the <code>STOPPED</code> state and the service sends back an HTTP 200 response with an empty HTTP body.</p>

    Args:
        entity_recognizer_arn: <p>The Amazon Resource Name (ARN) that identifies the entity recognizer currently being trained.</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.too_many_requests_exception.TooManyRequestsException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_comprehend.types.stop_training_entity_recognizer_request.StopTrainingEntityRecognizerRequest]",
    ) -> AsyncOperationResponse[
        "capo_comprehend.types.stop_training_entity_recognizer_response.StopTrainingEntityRecognizerResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.stop_training_entity_recognizer

        (
            output,
            http_response,
        ) = await capo_comprehend._operations.comprehend_20171127.stop_training_entity_recognizer.async_stop_training_entity_recognizer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopTrainingEntityRecognizer")
    )
    input_: capo_comprehend.types.stop_training_entity_recognizer_request.StopTrainingEntityRecognizerRequest = {
        "entity_recognizer_arn": entity_recognizer_arn
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output