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.DetectEntities 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.DetectEntities' paths: /#X-Amz-Target=Comprehend_20171127.DetectEntities: 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: DetectEntities description:
Detects named entities in input text when you use the pre-trained model. Detects custom entities if you have a custom entity recognition model.
When detecting named entities using the pre-trained model, use plain text as the input. For more information about named entities, see Entities in the Comprehend Developer Guide.
When you use a custom entity recognition model, 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 for each error.
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.
The X and Y coordinates of a point on a document page.
For additional information, see Point in the Amazon Textract API reference.
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. StringList: type: array items: $ref: '#/components/schemas/String' BoundingBox: type: object properties: Height: allOf: - $ref: '#/components/schemas/Float' - description: The height of the bounding box as a ratio of the overall document page height. Left: allOf: - $ref: '#/components/schemas/Float' - description: The left coordinate of the bounding box as a ratio of overall document page width. Top: allOf: - $ref: '#/components/schemas/Float' - description: The top coordinate of the bounding box as a ratio of overall document page height. Width: allOf: - $ref: '#/components/schemas/Float' - description: The width of the bounding box as a ratio of the overall document page width. description:The bounding box around the detected page or around an element on a document page. The left (x-coordinate) and top (y-coordinate) are coordinates that represent the top and left sides of the bounding box. Note that the upper-left corner of the image is the origin (0,0).
For additional information, see BoundingBox in the Amazon Textract API reference.
TextSizeLimitExceededException: {} Entity: type: object properties: Score: allOf: - $ref: '#/components/schemas/Float' - description: The level of confidence that Amazon Comprehend has in the accuracy of the detection. Type: allOf: - $ref: '#/components/schemas/EntityType' - description:The entity type. For entity detection using the built-in model, this field contains one of the standard entity types listed below.
For custom entity detection, this field contains one of the entity types that you specified when you trained your custom model.
Text: allOf: - $ref: '#/components/schemas/String' - description: The text of the entity. BeginOffset: allOf: - $ref: '#/components/schemas/Integer' - description:The zero-based offset from the beginning of the source text to the first character in the entity.
This field is empty for non-text input.
EndOffset: allOf: - $ref: '#/components/schemas/Integer' - description:The zero-based offset from the beginning of the source text to the last character in the entity.
This field is empty for non-text input.
BlockReferences: allOf: - $ref: '#/components/schemas/ListOfBlockReferences' - description: A reference to each block for this entity. This field is empty for plain-text input. description:Provides information about an entity.
RelationshipType: type: string enum: - CHILD ListOfEntities: type: array items: $ref: '#/components/schemas/Entity' 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:
TEXTRACT_DETECT_DOCUMENT_TEXT - The Amazon Comprehend service uses the DetectDocumentText API operation.
TEXTRACT_ANALYZE_DOCUMENT - The Amazon Comprehend service uses the AnalyzeDocument API operation.
Determines the text extraction actions for PDF files. Enter one of the following values:
SERVICE_DEFAULT - use the Amazon Comprehend service defaults for PDF files.
FORCE_DOCUMENT_READ_ACTION - Amazon Comprehend uses the Textract API specified by DocumentReadAction for all PDF files, including digital PDF files.
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:
TABLES - Returns information about any tables that are detected in the input document.
FORMS - Returns information and the data from any forms that are detected in the input document.
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:
Word files - Amazon Comprehend parser extracts the text.
Digital PDF files - Amazon Comprehend parser extracts the text.
Image files and scanned PDF files - Amazon Comprehend uses the Amazon Textract DetectDocumentText API to extract the text.
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.
' Block: type: object properties: Id: allOf: - $ref: '#/components/schemas/String' - description: Unique identifier for the block. BlockType: allOf: - $ref: '#/components/schemas/BlockType' - description:The block represents a line of text or one word of text.
WORD - A word that's detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces.
LINE - A string of tab-delimited, contiguous words that are detected on a document page
Information about each word or line of text in the input document.
For additional information, see Block in the Amazon Textract API reference.
BlockReference: type: object properties: BlockId: allOf: - $ref: '#/components/schemas/String' - description: Unique identifier for the block. BeginOffset: allOf: - $ref: '#/components/schemas/Integer' - description: Offset of the start of the block within its parent block. EndOffset: allOf: - $ref: '#/components/schemas/Integer' - description: Offset of the end of the block within its parent block. ChildBlocks: allOf: - $ref: '#/components/schemas/ListOfChildBlocks' - description: List of child blocks within this block. description: 'A reference to a block. ' ListOfBlocks: type: array items: $ref: '#/components/schemas/Block' ListOfBlockReferences: type: array items: $ref: '#/components/schemas/BlockReference' RelationshipsListItem: type: object properties: Ids: allOf: - $ref: '#/components/schemas/StringList' - description: Identifers of the child blocks. Type: allOf: - $ref: '#/components/schemas/RelationshipType' - description: Only supported relationship is a child relationship. description: List of child blocks for the current block. ResourceUnavailableException: {} DocumentType: type: string enum: - NATIVE_PDF - SCANNED_PDF - MS_WORD - IMAGE - PLAIN_TEXT - TEXTRACT_DETECT_DOCUMENT_TEXT_JSON - TEXTRACT_ANALYZE_DOCUMENT_JSON DetectEntitiesRequest: type: object title: DetectEntitiesRequest properties: Text: allOf: - $ref: '#/components/schemas/CustomerInputString' - description: A UTF-8 text string. The maximum string size is 100 KB. If you enter text using this parameter, do not use theBytes parameter.
LanguageCode:
allOf:
- $ref: '#/components/schemas/LanguageCode'
- description: The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. If your request includes the endpoint for a custom entity recognition model, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you specify here.
All input documents must be in the same language.
EndpointArn: allOf: - $ref: '#/components/schemas/EntityRecognizerEndpointArn' - description:The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model. Provide an endpoint if you want to detect entities by using your own custom model instead of the default model that is used by Amazon Comprehend.
If you specify an endpoint, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you provide in your request.
For information about endpoints, see Managing endpoints.
Bytes: allOf: - $ref: '#/components/schemas/SemiStructuredDocumentBlob' - description:This field applies only when you use a custom entity recognition model that was trained with PDF annotations. For other cases, enter your text input in the Text field.
Use the Bytes parameter to input a text, PDF, Word or image file. Using a plain-text file in the Bytes parameter is equivelent to using the Text parameter (the Entities field in the response is identical).
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 detect entities, 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.
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:
TABLES - Returns additional information about any tables that are detected in the input document.
FORMS - Returns additional information about any forms that are detected in the input document.
Text extraction encountered one or more page-level errors in the input document.
The ErrorCode contains one of the following values:
TEXTRACT_BAD_PAGE - Amazon Textract cannot read the page. For more information about page limits in Amazon Textract, see Page Quotas in Amazon Textract.
TEXTRACT_PROVISIONED_THROUGHPUT_EXCEEDED - The number of requests exceeded your throughput limit. For more information about throughput quotas in Amazon Textract, see Default quotas in Amazon Textract.
PAGE_CHARACTERS_EXCEEDED - Too many text characters on the page (10,000 characters maximum).
PAGE_SIZE_EXCEEDED - The maximum page size is 10 MB.
INTERNAL_SERVER_ERROR - The request encountered a service issue. Try the API request again.
A collection of entities identified in the input text. For each entity, the response provides the entity text, entity type, where the entity text begins and ends, and the level of confidence that Amazon Comprehend has in the detection.
If your request uses a custom entity recognition model, Amazon Comprehend detects the entities that the model is trained to recognize. Otherwise, it detects the default entity types. For a list of default entity types, see Entities in the Comprehend Developer Guide.
DocumentMetadata: allOf: - $ref: '#/components/schemas/DocumentMetadata' - description: 'Information about the document, discovered during text extraction. This field is present in the response only if your request used theByte 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 used the Byte parameter. '
Blocks:
allOf:
- $ref: '#/components/schemas/ListOfBlocks'
- description: Information about each block of text in the input document. Blocks are nested. A page block contains a block for each line of text, which contains a block for each word.
The Block content for a Word input document does not include a Geometry field.
The Block field is not present in the response for plain-text inputs.
Information about the location of items on a document page.
For additional information, see Geometry in the Amazon Textract API reference.
ListOfExtractedCharacters: type: array items: $ref: '#/components/schemas/ExtractedCharactersListItem' EntityRecognizerEndpointArn: type: string pattern: arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:entity-recognizer-endpoint/[a-zA-Z0-9](-*[a-zA-Z0-9])* maxLength: 256 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