The following code examples show how to use CreateDocumentClassifier
.
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:
- AWS CLI
-
To create a document classifier to categorize documents
The following
create-document-classifier
example begins the training process for a document classifier model. The training data file,training.csv
, is located at the--input-data-config
tag.training.csv
is a two column document where the labels, or, classifications are provided in the first column and the documents are provided in the second column.aws comprehend create-document-classifier \ --document-classifier-name
example-classifier
\ --data-access-arnarn:aws:comprehend:us-west-2:111122223333:pii-entities-detection-job/123456abcdeb0e11022f22a11EXAMPLE
\ --input-data-config"S3Uri=s3://amzn-s3-demo-bucket/"
\ --language-codeen
Output:
{ "DocumentClassifierArn": "arn:aws:comprehend:us-west-2:111122223333:document-classifier/example-classifier" }
For more information, see Custom Classification in the Amazon Comprehend Developer Guide.
-
For API details, see CreateDocumentClassifier
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using Amazon Comprehend with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.