There are more AWS SDK examples available in the AWS Doc SDK Examples
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-classifierexample deletes a custom document classifier model.aws comprehend delete-document-classifier \ --document-classifier-arnarn:aws:comprehend:us-west-2:111122223333:document-classifier/example-classifier-1This command produces no output.
For more information, see Managing Amazon Comprehend endpoints in the Amazon Comprehend Developer Guide.
-
For API details, see DeleteDocumentClassifier
in AWS CLI Command Reference.
-
- 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-
For API details, see DeleteDocumentClassifier in AWS SDK for Python (Boto3) API Reference.
-
- SAP ABAP
-
- SDK for SAP ABAP
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. TRY. oo_result = lo_cpd->deletedocumentclassifier( iv_documentclassifierarn = iv_classifier_arn ). MESSAGE 'Document classifier deleted.' TYPE 'I'. CATCH /aws1/cx_cpdinvalidrequestex. MESSAGE 'Invalid request.' TYPE 'E'. CATCH /aws1/cx_cpdtoomanyrequestsex. MESSAGE 'Too many requests.' TYPE 'E'. CATCH /aws1/cx_cpdresourcenotfoundex. MESSAGE 'Resource not found.' TYPE 'E'. CATCH /aws1/cx_cpdresourceinuseex. MESSAGE 'Resource in use.' TYPE 'E'. CATCH /aws1/cx_cpdinternalserverex. MESSAGE 'Internal server error occurred.' TYPE 'E'. ENDTRY.-
For API details, see DeleteDocumentClassifier in AWS SDK for SAP ABAP API reference.
-