openapi: 3.0.0 info: version: '2017-11-27' x-release: v4 title: 'Amazon Comprehend #X Amz Target=Comprehend 20171127.BatchDetectDominantLanguage #X Amz Target=Comprehend 20171127.BatchDetectDominantLanguage #X Amz Target=Comprehend 20171127.ClassifyDocument API' description: Amazon Comprehend is an Amazon Web Services service for gaining insight into the content of documents. Use these actions to determine the topics contained in your documents, the topics they discuss, the predominant sentiment expressed in them, the predominant language used, and more. x-logo: url: https://twitter.com/awscloud/profile_image?size=original backgroundColor: '#FFFFFF' termsOfService: https://aws.amazon.com/service-terms/ contact: name: Mike Ralphson email: mike.ralphson@gmail.com url: https://github.com/mermade/aws2openapi x-twitter: PermittedSoc license: name: Apache 2.0 License url: http://www.apache.org/licenses/ x-providerName: amazonaws.com x-serviceName: comprehend x-aws-signingName: comprehend x-origin: - contentType: application/json url: https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/comprehend-2017-11-27.normal.json converter: url: https://github.com/mermade/aws2openapi version: 1.0.0 x-apisguru-driver: external x-apiClientRegistration: url: https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct x-apisguru-categories: - cloud x-preferred: true servers: - url: http://comprehend.{region}.amazonaws.com variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The Amazon Comprehend multi-region endpoint - url: https://comprehend.{region}.amazonaws.com variables: region: description: The AWS region enum: - us-east-1 - us-east-2 - us-west-1 - us-west-2 - us-gov-west-1 - us-gov-east-1 - ca-central-1 - eu-north-1 - eu-west-1 - eu-west-2 - eu-west-3 - eu-central-1 - eu-south-1 - af-south-1 - ap-northeast-1 - ap-northeast-2 - ap-northeast-3 - ap-southeast-1 - ap-southeast-2 - ap-east-1 - ap-south-1 - sa-east-1 - me-south-1 default: us-east-1 description: The Amazon Comprehend multi-region endpoint - url: http://comprehend.{region}.amazonaws.com.cn variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The Amazon Comprehend endpoint for China (Beijing) and China (Ningxia) - url: https://comprehend.{region}.amazonaws.com.cn variables: region: description: The AWS region enum: - cn-north-1 - cn-northwest-1 default: cn-north-1 description: The Amazon Comprehend endpoint for China (Beijing) and China (Ningxia) security: - hmac: [] tags: - name: '#X Amz Target=Comprehend 20171127.ClassifyDocument' paths: /#X-Amz-Target=Comprehend_20171127.ClassifyDocument: parameters: - $ref: '#/components/parameters/X-Amz-Content-Sha256' - $ref: '#/components/parameters/X-Amz-Date' - $ref: '#/components/parameters/X-Amz-Algorithm' - $ref: '#/components/parameters/X-Amz-Credential' - $ref: '#/components/parameters/X-Amz-Security-Token' - $ref: '#/components/parameters/X-Amz-Signature' - $ref: '#/components/parameters/X-Amz-SignedHeaders' post: operationId: ClassifyDocument description:

Creates a new document classification request to analyze a single document in real-time, using a previously created and trained custom model and an endpoint.

You can input plain text or you can upload a single-page input document (text, PDF, Word, or image).

If the system detects errors while processing a page in the input document, the API response includes an entry in Errors that describes the errors.

If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide.

responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/ClassifyDocumentResponse' examples: ClassifyDocument200Example: summary: Default ClassifyDocument 200 x-microcks-default: true value: Classes: example Labels: example DocumentMetadata: example DocumentType: example Errors: example Warnings: example '480': description: InvalidRequestException content: application/json: schema: $ref: '#/components/schemas/InvalidRequestException' examples: ClassifyDocument480Example: summary: Default ClassifyDocument 480 x-microcks-default: true value: example '481': description: ResourceUnavailableException content: application/json: schema: $ref: '#/components/schemas/ResourceUnavailableException' examples: ClassifyDocument481Example: summary: Default ClassifyDocument 481 x-microcks-default: true value: example '482': description: TextSizeLimitExceededException content: application/json: schema: $ref: '#/components/schemas/TextSizeLimitExceededException' examples: ClassifyDocument482Example: summary: Default ClassifyDocument 482 x-microcks-default: true value: example '483': description: InternalServerException content: application/json: schema: $ref: '#/components/schemas/InternalServerException' examples: ClassifyDocument483Example: summary: Default ClassifyDocument 483 x-microcks-default: true value: example requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ClassifyDocumentRequest' parameters: - name: X-Amz-Target in: header required: true schema: type: string enum: - Comprehend_20171127.ClassifyDocument summary: Amazon Comprehend Classify Document x-microcks-operation: delay: 0 dispatcher: FALLBACK tags: - '#X Amz Target=Comprehend 20171127.ClassifyDocument' components: schemas: DocumentReadMode: type: string enum: - SERVICE_DEFAULT - FORCE_DOCUMENT_READ_ACTION WarningsListItem: type: object properties: Page: allOf: - $ref: '#/components/schemas/Integer' - description: Page number in the input document. WarnCode: allOf: - $ref: '#/components/schemas/PageBasedWarningCode' - description: The type of warning. WarnMessage: allOf: - $ref: '#/components/schemas/String' - description: Text message associated with the warning. description:

The system identified one of the following warnings while processing the input document:

DocumentTypeListItem: type: object properties: Page: allOf: - $ref: '#/components/schemas/Integer' - description: Page number. Type: allOf: - $ref: '#/components/schemas/DocumentType' - description: Document type. description: Document type for each page in the document. TextSizeLimitExceededException: {} DocumentReaderConfig: type: object required: - DocumentReadAction properties: DocumentReadAction: allOf: - $ref: '#/components/schemas/DocumentReadAction' - description:

This field defines the Amazon Textract API operation that Amazon Comprehend uses to extract text from PDF files and image files. Enter one of the following values:

DocumentReadMode: allOf: - $ref: '#/components/schemas/DocumentReadMode' - description:

Determines the text extraction actions for PDF files. Enter one of the following values:

FeatureTypes: allOf: - $ref: '#/components/schemas/ListOfDocumentReadFeatureTypes' - description:

Specifies the type of Amazon Textract features to apply. If you chose TEXTRACT_ANALYZE_DOCUMENT as the read action, you must specify one or both of the following values:

description: '

Provides configuration parameters to override the default actions for extracting text from PDF documents and image files.

By default, Amazon Comprehend performs the following actions to extract text from files, based on the input file type:

DocumentReaderConfig does not apply to plain text files or Word files.

For image files and PDF documents, you can override these default actions using the fields listed below. For more information, see Setting text extraction options in the Comprehend Developer Guide.

' DocumentClassifierEndpointArn: type: string pattern: arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:document-classifier-endpoint/[a-zA-Z0-9](-*[a-zA-Z0-9])* maxLength: 256 ClassifyDocumentResponse: type: object properties: Classes: allOf: - $ref: '#/components/schemas/ListOfClasses' - description: 'The classes used by the document being analyzed. These are used for multi-class trained models. Individual classes are mutually exclusive and each document is expected to have only a single class assigned to it. For example, an animal can be a dog or a cat, but not both at the same time. ' Labels: allOf: - $ref: '#/components/schemas/ListOfLabels' - description: 'The labels used the document being analyzed. These are used for multi-label trained models. Individual labels represent different categories that are related in some manner and are not mutually exclusive. For example, a movie can be just an action movie, or it can be an action movie, a science fiction movie, and a comedy, all at the same time. ' DocumentMetadata: allOf: - $ref: '#/components/schemas/DocumentMetadata' - description: 'Extraction information about the document. This field is present in the response only if your request includes the Byte parameter. ' DocumentType: allOf: - $ref: '#/components/schemas/ListOfDocumentType' - description: 'The document type for each page in the input document. This field is present in the response only if your request includes the Byte parameter. ' Errors: allOf: - $ref: '#/components/schemas/ListOfErrors' - description: Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors. Warnings: allOf: - $ref: '#/components/schemas/ListOfWarnings' - description:

Warnings detected while processing the input document. The response includes a warning if there is a mismatch between the input document type and the model type associated with the endpoint that you specified. The response can also include warnings for individual pages that have a mismatch.

The field is empty if the system generated no warnings.

ResourceUnavailableException: {} DocumentType: type: string enum: - NATIVE_PDF - SCANNED_PDF - MS_WORD - IMAGE - PLAIN_TEXT - TEXTRACT_DETECT_DOCUMENT_TEXT_JSON - TEXTRACT_ANALYZE_DOCUMENT_JSON PageBasedWarningCode: type: string enum: - INFERENCING_PLAINTEXT_WITH_NATIVE_TRAINED_MODEL - INFERENCING_NATIVE_DOCUMENT_WITH_PLAINTEXT_TRAINED_MODEL SemiStructuredDocumentBlob: type: string minLength: 1 InvalidRequestException: {} DocumentReadFeatureTypes: type: string enum: - TABLES - FORMS description:

Specifies the type of Amazon Textract features to apply. If you chose TEXTRACT_ANALYZE_DOCUMENT as the read action, you must specify one or both of the following values:

Float: type: number format: float String: type: string minLength: 1 DocumentMetadata: type: object properties: Pages: allOf: - $ref: '#/components/schemas/Integer' - description: Number of pages in the document. ExtractedCharacters: allOf: - $ref: '#/components/schemas/ListOfExtractedCharacters' - description: List of pages in the document, with the number of characters extracted from each page. description: Information about the document, discovered during text extraction. ListOfClasses: type: array items: $ref: '#/components/schemas/DocumentClass' DocumentLabel: type: object properties: Name: allOf: - $ref: '#/components/schemas/String' - description: The name of the label. Score: allOf: - $ref: '#/components/schemas/Float' - description: The confidence score that Amazon Comprehend has this label correctly attributed. Page: allOf: - $ref: '#/components/schemas/Integer' - description: 'Page number where the label occurs. This field is present in the response only if your request includes the Byte parameter. ' description: Specifies one of the label or labels that categorize the document being analyzed. DocumentClass: type: object properties: Name: allOf: - $ref: '#/components/schemas/String' - description: The name of the class. Score: allOf: - $ref: '#/components/schemas/Float' - description: The confidence score that Amazon Comprehend has this class correctly attributed. Page: allOf: - $ref: '#/components/schemas/Integer' - description: 'Page number in the input document. This field is present in the response only if your request includes the Byte parameter. ' description: Specifies the class that categorizes the document being analyzed ListOfWarnings: type: array items: $ref: '#/components/schemas/WarningsListItem' ListOfErrors: type: array items: $ref: '#/components/schemas/ErrorsListItem' Integer: type: integer ErrorsListItem: type: object properties: Page: allOf: - $ref: '#/components/schemas/Integer' - description: Page number where the error occurred. ErrorCode: allOf: - $ref: '#/components/schemas/PageBasedErrorCode' - description: Error code for the cause of the error. ErrorMessage: allOf: - $ref: '#/components/schemas/String' - description: Text message explaining the reason for the error. description:

Text extraction encountered one or more page-level errors in the input document.

The ErrorCode contains one of the following values:

PageBasedErrorCode: type: string enum: - TEXTRACT_BAD_PAGE - TEXTRACT_PROVISIONED_THROUGHPUT_EXCEEDED - PAGE_CHARACTERS_EXCEEDED - PAGE_SIZE_EXCEEDED - INTERNAL_SERVER_ERROR ListOfDocumentReadFeatureTypes: type: array items: $ref: '#/components/schemas/DocumentReadFeatureTypes' minItems: 1 maxItems: 2 ClassifyDocumentRequest: type: object required: - EndpointArn title: ClassifyDocumentRequest properties: Text: allOf: - $ref: '#/components/schemas/CustomerInputString' - description: The document text to be analyzed. If you enter text using this parameter, do not use the Bytes parameter. EndpointArn: allOf: - $ref: '#/components/schemas/DocumentClassifierEndpointArn' - description: The Amazon Resource Number (ARN) of the endpoint. For information about endpoints, see Managing endpoints. Bytes: allOf: - $ref: '#/components/schemas/SemiStructuredDocumentBlob' - description:

Use the Bytes parameter to input a text, PDF, Word or image file. You can also use the Bytes parameter to input an Amazon Textract DetectDocumentText or AnalyzeDocument output file.

Provide the input document as a sequence of base64-encoded bytes. If your code uses an Amazon Web Services SDK to classify documents, the SDK may encode the document file bytes for you.

The maximum length of this field depends on the input document type. For details, see Inputs for real-time custom analysis in the Comprehend Developer Guide.

If you use the Bytes parameter, do not use the Text parameter.

DocumentReaderConfig: allOf: - $ref: '#/components/schemas/DocumentReaderConfig' - description: Provides configuration parameters to override the default actions for extracting text from PDF documents and image files. ListOfLabels: type: array items: $ref: '#/components/schemas/DocumentLabel' CustomerInputString: type: string minLength: 1 format: password ExtractedCharactersListItem: type: object properties: Page: allOf: - $ref: '#/components/schemas/Integer' - description: Page number. Count: allOf: - $ref: '#/components/schemas/Integer' - description: Number of characters extracted from each page. description: Array of the number of characters extracted from each page. InternalServerException: {} DocumentReadAction: type: string enum: - TEXTRACT_DETECT_DOCUMENT_TEXT - TEXTRACT_ANALYZE_DOCUMENT ListOfDocumentType: type: array items: $ref: '#/components/schemas/DocumentTypeListItem' ListOfExtractedCharacters: type: array items: $ref: '#/components/schemas/ExtractedCharactersListItem' parameters: X-Amz-Date: name: X-Amz-Date in: header schema: type: string required: false X-Amz-SignedHeaders: name: X-Amz-SignedHeaders in: header schema: type: string required: false X-Amz-Credential: name: X-Amz-Credential in: header schema: type: string required: false X-Amz-Content-Sha256: name: X-Amz-Content-Sha256 in: header schema: type: string required: false X-Amz-Algorithm: name: X-Amz-Algorithm in: header schema: type: string required: false X-Amz-Signature: name: X-Amz-Signature in: header schema: type: string required: false X-Amz-Security-Token: name: X-Amz-Security-Token in: header schema: type: string required: false securitySchemes: hmac: type: apiKey name: Authorization in: header description: Amazon Signature authorization v4 x-amazon-apigateway-authtype: awsSigv4 externalDocs: description: Amazon Web Services documentation url: https://docs.aws.amazon.com/comprehend/ x-hasEquivalentPaths: true