Use DeleteDocumentClassifier with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DeleteDocumentClassifier with an AWS SDK or CLI

The following code examples show how to use DeleteDocumentClassifier.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

CLI
AWS CLI

To delete a custom document classifier

The following delete-document-classifier example deletes a custom document classifier model.

aws comprehend delete-document-classifier \ --document-classifier-arn arn:aws:comprehend:us-west-2:111122223333:document-classifier/example-classifier-1

This command produces no output.

For more information, see Managing Amazon Comprehend endpoints in the Amazon Comprehend Developer Guide.

Python
SDK for Python (Boto3)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

class ComprehendClassifier: """Encapsulates an Amazon Comprehend custom classifier.""" def __init__(self, comprehend_client): """ :param comprehend_client: A Boto3 Comprehend client. """ self.comprehend_client = comprehend_client self.classifier_arn = None def delete(self): """ Deletes the classifier. """ try: self.comprehend_client.delete_document_classifier( DocumentClassifierArn=self.classifier_arn ) logger.info("Deleted classifier %s.", self.classifier_arn) self.classifier_arn = None except ClientError: logger.exception("Couldn't deleted classifier %s.", self.classifier_arn) raise