ListDocumentClassifiersCommand

Gets a list of the document classifiers that you have created.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ComprehendClient, ListDocumentClassifiersCommand } from "@aws-sdk/client-comprehend"; // ES Modules import
// const { ComprehendClient, ListDocumentClassifiersCommand } = require("@aws-sdk/client-comprehend"); // CommonJS import
const client = new ComprehendClient(config);
const input = { // ListDocumentClassifiersRequest
  Filter: { // DocumentClassifierFilter
    Status: "SUBMITTED" || "TRAINING" || "DELETING" || "STOP_REQUESTED" || "STOPPED" || "IN_ERROR" || "TRAINED" || "TRAINED_WITH_WARNING",
    DocumentClassifierName: "STRING_VALUE",
    SubmitTimeBefore: new Date("TIMESTAMP"),
    SubmitTimeAfter: new Date("TIMESTAMP"),
  },
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new ListDocumentClassifiersCommand(input);
const response = await client.send(command);
// { // ListDocumentClassifiersResponse
//   DocumentClassifierPropertiesList: [ // DocumentClassifierPropertiesList
//     { // DocumentClassifierProperties
//       DocumentClassifierArn: "STRING_VALUE",
//       LanguageCode: "en" || "es" || "fr" || "de" || "it" || "pt" || "ar" || "hi" || "ja" || "ko" || "zh" || "zh-TW",
//       Status: "SUBMITTED" || "TRAINING" || "DELETING" || "STOP_REQUESTED" || "STOPPED" || "IN_ERROR" || "TRAINED" || "TRAINED_WITH_WARNING",
//       Message: "STRING_VALUE",
//       SubmitTime: new Date("TIMESTAMP"),
//       EndTime: new Date("TIMESTAMP"),
//       TrainingStartTime: new Date("TIMESTAMP"),
//       TrainingEndTime: new Date("TIMESTAMP"),
//       InputDataConfig: { // DocumentClassifierInputDataConfig
//         DataFormat: "COMPREHEND_CSV" || "AUGMENTED_MANIFEST",
//         S3Uri: "STRING_VALUE",
//         TestS3Uri: "STRING_VALUE",
//         LabelDelimiter: "STRING_VALUE",
//         AugmentedManifests: [ // DocumentClassifierAugmentedManifestsList
//           { // AugmentedManifestsListItem
//             S3Uri: "STRING_VALUE", // required
//             Split: "TRAIN" || "TEST",
//             AttributeNames: [ // AttributeNamesList // required
//               "STRING_VALUE",
//             ],
//             AnnotationDataS3Uri: "STRING_VALUE",
//             SourceDocumentsS3Uri: "STRING_VALUE",
//             DocumentType: "PLAIN_TEXT_DOCUMENT" || "SEMI_STRUCTURED_DOCUMENT",
//           },
//         ],
//         DocumentType: "PLAIN_TEXT_DOCUMENT" || "SEMI_STRUCTURED_DOCUMENT",
//         Documents: { // DocumentClassifierDocuments
//           S3Uri: "STRING_VALUE", // required
//           TestS3Uri: "STRING_VALUE",
//         },
//         DocumentReaderConfig: { // DocumentReaderConfig
//           DocumentReadAction: "TEXTRACT_DETECT_DOCUMENT_TEXT" || "TEXTRACT_ANALYZE_DOCUMENT", // required
//           DocumentReadMode: "SERVICE_DEFAULT" || "FORCE_DOCUMENT_READ_ACTION",
//           FeatureTypes: [ // ListOfDocumentReadFeatureTypes
//             "TABLES" || "FORMS",
//           ],
//         },
//       },
//       OutputDataConfig: { // DocumentClassifierOutputDataConfig
//         S3Uri: "STRING_VALUE",
//         KmsKeyId: "STRING_VALUE",
//         FlywheelStatsS3Prefix: "STRING_VALUE",
//       },
//       ClassifierMetadata: { // ClassifierMetadata
//         NumberOfLabels: Number("int"),
//         NumberOfTrainedDocuments: Number("int"),
//         NumberOfTestDocuments: Number("int"),
//         EvaluationMetrics: { // ClassifierEvaluationMetrics
//           Accuracy: Number("double"),
//           Precision: Number("double"),
//           Recall: Number("double"),
//           F1Score: Number("double"),
//           MicroPrecision: Number("double"),
//           MicroRecall: Number("double"),
//           MicroF1Score: Number("double"),
//           HammingLoss: Number("double"),
//         },
//       },
//       DataAccessRoleArn: "STRING_VALUE",
//       VolumeKmsKeyId: "STRING_VALUE",
//       VpcConfig: { // VpcConfig
//         SecurityGroupIds: [ // SecurityGroupIds // required
//           "STRING_VALUE",
//         ],
//         Subnets: [ // Subnets // required
//           "STRING_VALUE",
//         ],
//       },
//       Mode: "MULTI_CLASS" || "MULTI_LABEL",
//       ModelKmsKeyId: "STRING_VALUE",
//       VersionName: "STRING_VALUE",
//       SourceModelArn: "STRING_VALUE",
//       FlywheelArn: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListDocumentClassifiersCommand Input

Parameter
Type
Description
Filter
DocumentClassifierFilter | undefined

Filters the jobs that are returned. You can filter jobs on their name, status, or the date and time that they were submitted. You can only set one filter at a time.

MaxResults
number | undefined

The maximum number of results to return in each page. The default is 100.

NextToken
string | undefined

Identifies the next page of results to return.

ListDocumentClassifiersCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
DocumentClassifierPropertiesList
DocumentClassifierProperties[] | undefined

A list containing the properties of each job returned.

NextToken
string | undefined

Identifies the next page of results to return.

Throws

Name
Fault
Details
InternalServerException
server

An internal server error occurred. Retry your request.

InvalidFilterException
client

The filter specified for the operation is invalid. Specify a different filter.

InvalidRequestException
client

The request is invalid.

TooManyRequestsException
client

The number of requests exceeds the limit. Resubmit your request later.

ComprehendServiceException
Base exception class for all service exceptions from Comprehend service.