Module Smaws_Client_Textract.Types

type nonrec error_code = string
type nonrec u_integer = int
type nonrec pages = u_integer list
type nonrec warning = {
  1. pages : pages option;
    (*

    A list of the pages that the warning applies to.

    *)
  2. error_code : error_code option;
    (*

    The error code for the warning.

    *)
}

A warning about an issue that occurred during asynchronous text analysis (StartDocumentAnalysis) or asynchronous document text detection (StartDocumentTextDetection).

type nonrec warnings = warning list
type nonrec value_type =
  1. | DATE
type nonrec string_ = string
type nonrec validation_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Indicates that a request was not valid. Check request for proper formatting.

type nonrec adapter_id = string
type nonrec adapter_name = string
type nonrec date_time = Smaws_Lib.CoreTypes.Timestamp.t
type nonrec adapter_description = string
type nonrec feature_type =
  1. | LAYOUT
  2. | SIGNATURES
  3. | QUERIES
  4. | FORMS
  5. | TABLES
type nonrec feature_types = feature_type list
type nonrec auto_update =
  1. | DISABLED
  2. | ENABLED
type nonrec update_adapter_response = {
  1. auto_update : auto_update option;
    (*

    The auto-update status of the adapter that has been updated.

    *)
  2. feature_types : feature_types option;
    (*

    List of the targeted feature types for the updated adapter.

    *)
  3. description : adapter_description option;
    (*

    A string containing the description of the adapter that has been updated.

    *)
  4. creation_time : date_time option;
    (*

    An object specifying the creation time of the the adapter that has been updated.

    *)
  5. adapter_name : adapter_name option;
    (*

    A string containing the name of the adapter that has been updated.

    *)
  6. adapter_id : adapter_id option;
    (*

    A string containing a unique ID for the adapter that has been updated.

    *)
}
type nonrec update_adapter_request = {
  1. auto_update : auto_update option;
    (*

    The new auto-update status to be applied to the adapter.

    *)
  2. adapter_name : adapter_name option;
    (*

    The new name to be applied to the adapter.

    *)
  3. description : adapter_description option;
    (*

    The new description to be applied to the adapter.

    *)
  4. adapter_id : adapter_id;
    (*

    A string containing a unique ID for the adapter that will be updated.

    *)
}
type nonrec throttling_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Amazon Textract is temporarily unable to process the request. Try your call again.

type nonrec resource_not_found_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Returned when an operation tried to access a nonexistent resource.

type nonrec provisioned_throughput_exceeded_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Textract.

type nonrec invalid_parameter_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

An input parameter violated a constraint. For example, in synchronous operations, an InvalidParameterException exception occurs when neither of the S3Object or Bytes values are supplied in the Document request parameter. Validate your parameter before calling the API operation again.

type nonrec internal_server_error = {
  1. code : string_ option;
  2. message : string_ option;
}

Amazon Textract experienced a service issue. Try your call again.

type nonrec conflict_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Updating or deleting a resource can cause an inconsistent state.

type nonrec access_denied_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

You aren't authorized to perform the action. Use the Amazon Resource Name (ARN) of an authorized user or IAM role to perform the operation.

type nonrec untag_resource_response = unit
type nonrec amazon_resource_name = string
type nonrec tag_key = string
type nonrec tag_key_list = tag_key list
type nonrec untag_resource_request = {
  1. tag_keys : tag_key_list;
    (*

    Specifies the tags to be removed from the resource specified by the ResourceARN.

    *)
  2. resource_ar_n : amazon_resource_name;
    (*

    The Amazon Resource Name (ARN) that specifies the resource to be untagged.

    *)
}
type nonrec unsupported_document_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

The format of the input document isn't supported. Documents for operations can be in PNG, JPEG, PDF, or TIFF format.

type nonrec undetected_signature = {
  1. page : u_integer option;
    (*

    The page where a signature was expected but not found.

    *)
}

A structure containing information about an undetected signature on a page where it was expected but not found.

type nonrec undetected_signature_list = undetected_signature list
type nonrec non_empty_string = string
type nonrec undetected_document_type_list = non_empty_string list
type nonrec service_quota_exceeded_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Returned when a request cannot be completed as it would exceed a maximum service quota.

type nonrec tag_resource_response = unit
type nonrec tag_value = string
type nonrec tag_map = (tag_key * tag_value) list
type nonrec tag_resource_request = {
  1. tags : tag_map;
    (*

    A set of tags (key-value pairs) that you want to assign to the resource.

    *)
  2. resource_ar_n : amazon_resource_name;
    (*

    The Amazon Resource Name (ARN) that specifies the resource to be tagged.

    *)
}
type nonrec limit_exceeded_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

An Amazon Textract service limit was exceeded. For example, if you start too many asynchronous jobs concurrently, calls to start operations (StartDocumentTextDetection, for example) raise a LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Textract service limit.

type nonrec invalid_s3_object_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Amazon Textract is unable to access the S3 object that's specified in the request. for more information, Configure Access to Amazon S3 For troubleshooting information, see Troubleshooting Amazon S3

type nonrec invalid_kms_key_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Indicates you do not have decrypt permissions with the KMS key entered, or the KMS key was entered incorrectly.

type nonrec idempotent_parameter_mismatch_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

A ClientRequestToken input parameter was reused with an operation, but at least one of the other input parameters is different from the previous call to the operation.

type nonrec document_too_large_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

The document can't be processed because it's too large. The maximum document size for synchronous operations 10 MB. The maximum document size for asynchronous operations is 500 MB for PDF files.

type nonrec bad_document_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

Amazon Textract isn't able to read the document. For more information on the document limits in Amazon Textract, see limits.

type nonrec job_id = string
type nonrec start_lending_analysis_response = {
  1. job_id : job_id option;
    (*

    A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec s3_bucket = string
type nonrec s3_object_name = string
type nonrec s3_object_version = string
type nonrec s3_object = {
  1. version : s3_object_version option;
    (*

    If the bucket has versioning enabled, you can specify the object version.

    *)
  2. name : s3_object_name option;
    (*

    The file name of the input document. Image files may be in PDF, TIFF, JPEG, or PNG format.

    *)
  3. bucket : s3_bucket option;
    (*

    The name of the S3 bucket. Note that the # character is not valid in the file name.

    *)
}

The S3 bucket name and file name that identifies the document.

The AWS Region for the S3 bucket that contains the document must match the Region that you use for Amazon Textract operations.

For Amazon Textract to process a file in an S3 bucket, the user must have permission to access the S3 bucket and file.

type nonrec document_location = {
  1. s3_object : s3_object option;
    (*

    The Amazon S3 bucket that contains the input document.

    *)
}

The Amazon S3 bucket that contains the document to be processed. It's used by asynchronous operations.

The input document can be an image file in JPEG or PNG format. It can also be a file in PDF format.

type nonrec client_request_token = string
type nonrec job_tag = string
type nonrec sns_topic_arn = string
type nonrec role_arn = string
type nonrec notification_channel = {
  1. role_arn : role_arn;
    (*

    The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic.

    *)
  2. sns_topic_arn : sns_topic_arn;
    (*

    The Amazon SNS topic that Amazon Textract posts the completion status to.

    *)
}

The Amazon Simple Notification Service (Amazon SNS) topic to which Amazon Textract publishes the completion status of an asynchronous document operation.

type nonrec output_config = {
  1. s3_prefix : s3_object_name option;
    (*

    The prefix of the object key that the output will be saved to. When not enabled, the prefix will be “textract_output".

    *)
  2. s3_bucket : s3_bucket;
    (*

    The name of the bucket your output will go to.

    *)
}

Sets whether or not your output will go to a user created bucket. Used to set the name of the bucket, and the prefix on the output file.

OutputConfig is an optional parameter which lets you adjust where your output will be placed. By default, Amazon Textract will store the results internally and can only be accessed by the Get API operations. With OutputConfig enabled, you can set the name of the bucket the output will be sent to the file prefix of the results where you can download your results. Additionally, you can set the KMSKeyID parameter to a customer master key (CMK) to encrypt your output. Without this parameter set Amazon Textract will encrypt server-side using the AWS managed CMK for Amazon S3.

Decryption of Customer Content is necessary for processing of the documents by Amazon Textract. If your account is opted out under an AI services opt out policy then all unencrypted Customer Content is immediately and permanently deleted after the Customer Content has been processed by the service. No copy of of the output is retained by Amazon Textract. For information about how to opt out, see Managing AI services opt-out policy.

For more information on data privacy, see the Data Privacy FAQ.

type nonrec kms_key_id = string
type nonrec start_lending_analysis_request = {
  1. kms_key_id : kms_key_id option;
    (*

    The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side, using SSE-S3.

    *)
  2. output_config : output_config option;
  3. notification_channel : notification_channel option;
  4. job_tag : job_tag option;
    (*

    An identifier that you specify to be included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).

    *)
  5. client_request_token : client_request_token option;
    (*

    The idempotent token that you use to identify the start request. If you use the same token with multiple StartLendingAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.

    *)
  6. document_location : document_location;
}
type nonrec start_expense_analysis_response = {
  1. job_id : job_id option;
    (*

    A unique identifier for the text detection job. The JobId is returned from StartExpenseAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec start_expense_analysis_request = {
  1. kms_key_id : kms_key_id option;
    (*

    The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side,using SSE-S3.

    *)
  2. output_config : output_config option;
    (*

    Sets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the GetExpenseAnalysis operation.

    *)
  3. notification_channel : notification_channel option;
    (*

    The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.

    *)
  4. job_tag : job_tag option;
    (*

    An identifier you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).

    *)
  5. client_request_token : client_request_token option;
    (*

    The idempotent token that's used to identify the start request. If you use the same token with multiple StartDocumentTextDetection requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations

    *)
  6. document_location : document_location;
    (*

    The location of the document to be processed.

    *)
}
type nonrec start_document_text_detection_response = {
  1. job_id : job_id option;
    (*

    The identifier of the text detection job for the document. Use JobId to identify the job in a subsequent call to GetDocumentTextDetection. A JobId value is only valid for 7 days.

    *)
}
type nonrec start_document_text_detection_request = {
  1. kms_key_id : kms_key_id option;
    (*

    The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side,using SSE-S3.

    *)
  2. output_config : output_config option;
    (*

    Sets if the output will go to a customer defined bucket. By default Amazon Textract will save the results internally to be accessed with the GetDocumentTextDetection operation.

    *)
  3. notification_channel : notification_channel option;
    (*

    The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.

    *)
  4. job_tag : job_tag option;
    (*

    An identifier that you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).

    *)
  5. client_request_token : client_request_token option;
    (*

    The idempotent token that's used to identify the start request. If you use the same token with multiple StartDocumentTextDetection requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.

    *)
  6. document_location : document_location;
    (*

    The location of the document to be processed.

    *)
}
type nonrec start_document_analysis_response = {
  1. job_id : job_id option;
    (*

    The identifier for the document text detection job. Use JobId to identify the job in a subsequent call to GetDocumentAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec query_input = string
type nonrec query_page = string
type nonrec query_pages = query_page list
type nonrec query = {
  1. pages : query_pages option;
    (*

    Pages is a parameter that the user inputs to specify which pages to apply a query to. The following is a list of rules for using this parameter.

    • If a page is not specified, it is set to ["1"] by default.
    • The following characters are allowed in the parameter's string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed.
    • When using * to indicate all pages, it must be the only element in the list.
    • You can use page intervals, such as [“1-3”, “1-1”, “4-*”]. Where * indicates last page of document.
    • Specified pages must be greater than 0 and less than or equal to the number of pages in the document.
    *)
  2. alias : query_input option;
    (*

    Alias attached to the query, for ease of location.

    *)
  3. text : query_input;
    (*

    Question that Amazon Textract will apply to the document. An example would be "What is the customer's SSN?"

    *)
}

Each query contains the question you want to ask in the Text and the alias you want to associate.

type nonrec queries = query list
type nonrec queries_config = {
  1. queries : queries;
}
type nonrec adapter_page = string
type nonrec adapter_pages = adapter_page list
type nonrec adapter_version = string
type nonrec adapter = {
  1. version : adapter_version;
    (*

    A string that identifies the version of the adapter.

    *)
  2. pages : adapter_pages option;
    (*

    Pages is a parameter that the user inputs to specify which pages to apply an adapter to. The following is a list of rules for using this parameter.

    • If a page is not specified, it is set to ["1"] by default.
    • The following characters are allowed in the parameter's string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed.
    • When using * to indicate all pages, it must be the only element in the list.
    • You can use page intervals, such as ["1-3", "1-1", "4-*"]. Where * indicates last page of document.
    • Specified pages must be greater than 0 and less than or equal to the number of pages in the document.
    *)
  3. adapter_id : adapter_id;
    (*

    A unique identifier for the adapter resource.

    *)
}

An adapter selected for use when analyzing documents. Contains an adapter ID and a version number. Contains information on pages selected for analysis when analyzing documents asychronously.

type nonrec adapters = adapter list
type nonrec adapters_config = {
  1. adapters : adapters;
    (*

    A list of adapters to be used when analyzing the specified document.

    *)
}

Contains information about adapters used when analyzing a document, with each adapter specified using an AdapterId and version

type nonrec start_document_analysis_request = {
  1. adapters_config : adapters_config option;
    (*

    Specifies the adapter to be used when analyzing a document.

    *)
  2. queries_config : queries_config option;
  3. kms_key_id : kms_key_id option;
    (*

    The KMS key used to encrypt the inference results. This can be in either Key ID or Key Alias format. When a KMS key is provided, the KMS key will be used for server-side encryption of the objects in the customer bucket. When this parameter is not enabled, the result will be encrypted server side,using SSE-S3.

    *)
  4. output_config : output_config option;
    (*

    Sets if the output will go to a customer defined bucket. By default, Amazon Textract will save the results internally to be accessed by the GetDocumentAnalysis operation.

    *)
  5. notification_channel : notification_channel option;
    (*

    The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.

    *)
  6. job_tag : job_tag option;
    (*

    An identifier that you specify that's included in the completion notification published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document that the completion notification corresponds to (such as a tax form or a receipt).

    *)
  7. client_request_token : client_request_token option;
    (*

    The idempotent token that you use to identify the start request. If you use the same token with multiple StartDocumentAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once. For more information, see Calling Amazon Textract Asynchronous Operations.

    *)
  8. feature_types : feature_types;
    (*

    A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. To perform both types of analysis, add TABLES and FORMS to FeatureTypes. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).

    *)
  9. document_location : document_location;
    (*

    The location of the document to be processed.

    *)
}
type nonrec list_tags_for_resource_response = {
  1. tags : tag_map option;
    (*

    A set of tags (key-value pairs) that are part of the requested resource.

    *)
}
type nonrec list_tags_for_resource_request = {
  1. resource_ar_n : amazon_resource_name;
    (*

    The Amazon Resource Name (ARN) that specifies the resource to list tags for.

    *)
}
type nonrec adapter_version_status =
  1. | CREATION_IN_PROGRESS
  2. | CREATION_ERROR
  3. | DEPRECATED
  4. | AT_RISK
  5. | ACTIVE
type nonrec adapter_version_status_message = string
type nonrec adapter_version_overview = {
  1. status_message : adapter_version_status_message option;
    (*

    A message explaining the status of a given adapter vesion.

    *)
  2. status : adapter_version_status option;
    (*

    Contains information on the status of a given adapter version.

    *)
  3. feature_types : feature_types option;
    (*

    The feature types that the adapter version is operating on.

    *)
  4. creation_time : date_time option;
    (*

    The date and time that a given adapter version was created.

    *)
  5. adapter_version : adapter_version option;
    (*

    An identified for a given adapter version.

    *)
  6. adapter_id : adapter_id option;
    (*

    A unique identifier for the adapter associated with a given adapter version.

    *)
}

Summary info for an adapter version. Contains information on the AdapterId, AdapterVersion, CreationTime, FeatureTypes, and Status.

type nonrec adapter_version_list = adapter_version_overview list
type nonrec pagination_token = string
type nonrec list_adapter_versions_response = {
  1. next_token : pagination_token option;
    (*

    Identifies the next page of results to return when listing adapter versions.

    *)
  2. adapter_versions : adapter_version_list option;
    (*

    Adapter versions that match the filtering criteria specified when calling ListAdapters.

    *)
}
type nonrec max_results = int
type nonrec list_adapter_versions_request = {
  1. next_token : pagination_token option;
    (*

    Identifies the next page of results to return when listing adapter versions.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return when listing adapter versions.

    *)
  3. before_creation_time : date_time option;
    (*

    Specifies the upper bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.

    *)
  4. after_creation_time : date_time option;
    (*

    Specifies the lower bound for the ListAdapterVersions operation. Ensures ListAdapterVersions returns only adapter versions created after the specified creation time.

    *)
  5. adapter_id : adapter_id option;
    (*

    A string containing a unique ID for the adapter to match for when listing adapter versions.

    *)
}
type nonrec adapter_overview = {
  1. feature_types : feature_types option;
    (*

    The feature types that the adapter is operating on.

    *)
  2. creation_time : date_time option;
    (*

    The date and time that the adapter was created.

    *)
  3. adapter_name : adapter_name option;
    (*

    A string naming the adapter resource.

    *)
  4. adapter_id : adapter_id option;
    (*

    A unique identifier for the adapter resource.

    *)
}

Contains information on the adapter, including the adapter ID, Name, Creation time, and feature types.

type nonrec adapter_list = adapter_overview list
type nonrec list_adapters_response = {
  1. next_token : pagination_token option;
    (*

    Identifies the next page of results to return when listing adapters.

    *)
  2. adapters : adapter_list option;
    (*

    A list of adapters that matches the filtering criteria specified when calling ListAdapters.

    *)
}
type nonrec list_adapters_request = {
  1. next_token : pagination_token option;
    (*

    Identifies the next page of results to return when listing adapters.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return when listing adapters.

    *)
  3. before_creation_time : date_time option;
    (*

    Specifies the upper bound for the ListAdapters operation. Ensures ListAdapters returns only adapters created before the specified creation time.

    *)
  4. after_creation_time : date_time option;
    (*

    Specifies the lower bound for the ListAdapters operation. Ensures ListAdapters returns only adapters created after the specified creation time.

    *)
}
type nonrec invalid_job_id_exception = {
  1. code : string_ option;
  2. message : string_ option;
}

An invalid job identifier was passed to an asynchronous analysis operation.

type nonrec document_metadata = {
  1. pages : u_integer option;
    (*

    The number of pages that are detected in the document.

    *)
}

Information about the input document.

type nonrec job_status =
  1. | PARTIAL_SUCCESS
  2. | FAILED
  3. | SUCCEEDED
  4. | IN_PROGRESS
type nonrec page_list = u_integer list
type nonrec split_document = {
  1. pages : page_list option;
    (*

    An array of page numbers for a for a given document, ordered by logical boundary.

    *)
  2. index : u_integer option;
    (*

    The index for a given document in a DocumentGroup of a specific Type.

    *)
}

Contains information about the pages of a document, defined by logical boundary.

type nonrec split_document_list = split_document list
type nonrec detected_signature = {
  1. page : u_integer option;
    (*

    The page a detected signature was found on.

    *)
}

A structure that holds information regarding a detected signature on a page.

type nonrec detected_signature_list = detected_signature list
type nonrec document_group = {
  1. undetected_signatures : undetected_signature_list option;
    (*

    A list of any expected signatures not found in a document group.

    *)
  2. detected_signatures : detected_signature_list option;
    (*

    A list of the detected signatures found in a document group.

    *)
  3. split_documents : split_document_list option;
    (*

    An array that contains information about the pages of a document, defined by logical boundary.

    *)
  4. type_ : non_empty_string option;
    (*

    The type of document that Amazon Textract has detected. See Analyze Lending Response Objects for a list of all types returned by Textract.

    *)
}

Summary information about documents grouped by the same document type.

type nonrec document_group_list = document_group list
type nonrec lending_summary = {
  1. undetected_document_types : undetected_document_type_list option;
    (*

    UndetectedDocumentTypes.

    *)
  2. document_groups : document_group_list option;
    (*

    Contains an array of all DocumentGroup objects.

    *)
}

Contains information regarding DocumentGroups and UndetectedDocumentTypes.

type nonrec status_message = string
type nonrec get_lending_analysis_summary_response = {
  1. analyze_lending_model_version : string_ option;
    (*

    The current model version of the Analyze Lending API.

    *)
  2. status_message : status_message option;
    (*

    Returns if the lending analysis could not be completed. Contains explanation for what error occurred.

    *)
  3. warnings : warnings option;
    (*

    A list of warnings that occurred during the lending analysis operation.

    *)
  4. summary : lending_summary option;
    (*

    Contains summary information for documents grouped by type.

    *)
  5. job_status : job_status option;
    (*

    The current status of the lending analysis job.

    *)
  6. document_metadata : document_metadata option;
}
type nonrec get_lending_analysis_summary_request = {
  1. job_id : job_id;
    (*

    A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec percent = float
type nonrec prediction = {
  1. confidence : percent option;
    (*

    Amazon Textract's confidence in its predicted value.

    *)
  2. value : non_empty_string option;
    (*

    The predicted value of a detected object.

    *)
}

Contains information regarding predicted values returned by Amazon Textract operations, including the predicted value and the confidence in the predicted value.

type nonrec prediction_list = prediction list
type nonrec page_classification = {
  1. page_number : prediction_list;
    (*

    The page number the value was detected on, relative to Amazon Textract's starting position.

    *)
  2. page_type : prediction_list;
    (*

    The class, or document type, assigned to a detected Page object. The class, or document type, assigned to a detected Page object.

    *)
}

The class assigned to a Page object detected in an input document. Contains information regarding the predicted type/class of a document's page and the page number that the Page object was detected on.

type nonrec selection_status =
  1. | NOT_SELECTED
  2. | SELECTED
type nonrec float_ = float
type nonrec bounding_box = {
  1. top : float_ option;
    (*

    The top coordinate of the bounding box as a ratio of overall document page height.

    *)
  2. left : float_ option;
    (*

    The left coordinate of the bounding box as a ratio of overall document page width.

    *)
  3. height : float_ option;
    (*

    The height of the bounding box as a ratio of the overall document page height.

    *)
  4. width : float_ option;
    (*

    The width of the bounding box as a ratio of the overall document page width.

    *)
}

The bounding box around the detected page, text, key-value pair, table, table cell, or selection 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).

The top and left values returned are ratios of the overall document page size. For example, if the input image is 700 x 200 pixels, and the top-left coordinate of the bounding box is 350 x 50 pixels, the API returns a left value of 0.5 (350/700) and a top value of 0.25 (50/200).

The width and height values represent the dimensions of the bounding box as a ratio of the overall document page dimension. For example, if the document page size is 700 x 200 pixels, and the bounding box width is 70 pixels, the width returned is 0.1.

type nonrec point = {
  1. y : float_ option;
    (*

    The value of the Y coordinate for a point on a Polygon.

    *)
  2. x : float_ option;
    (*

    The value of the X coordinate for a point on a Polygon.

    *)
}

The X and Y coordinates of a point on a document page. The X and Y values that are returned are ratios of the overall document page size. For example, if the input document is 700 x 200 and the operation returns X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the document page.

An array of Point objects, Polygon, is returned by DetectDocumentText. Polygon represents a fine-grained polygon around detected text. For more information, see Geometry in the Amazon Textract Developer Guide.

type nonrec polygon = point list
type nonrec angle = float
type nonrec geometry = {
  1. rotation_angle : angle option;
    (*

    Provides a numerical value corresponding to the rotation of the text.

    *)
  2. polygon : polygon option;
    (*

    Within the bounding box, a fine-grained polygon around the recognized item.

    *)
  3. bounding_box : bounding_box option;
    (*

    An axis-aligned coarse representation of the location of the recognized item on the document page.

    *)
}

Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.

type nonrec lending_detection = {
  1. confidence : percent option;
    (*

    The confidence level for the text of a detected value in a lending document.

    *)
  2. geometry : geometry option;
  3. selection_status : selection_status option;
    (*

    The selection status of a selection element, such as an option button or check box.

    *)
  4. text : string_ option;
    (*

    The text extracted for a detected value in a lending document.

    *)
}

The results extracted for a lending document.

type nonrec lending_detection_list = lending_detection list
type nonrec lending_field = {
  1. value_detections : lending_detection_list option;
    (*

    An array of LendingDetection objects.

    *)
  2. key_detection : lending_detection option;
  3. type_ : string_ option;
    (*

    The type of the lending document.

    *)
}

Holds the normalized key-value pairs returned by AnalyzeDocument, including the document type, detected text, and geometry.

type nonrec lending_field_list = lending_field list
type nonrec signature_detection = {
  1. geometry : geometry option;
  2. confidence : percent option;
    (*

    The confidence, from 0 to 100, in the predicted values for a detected signature.

    *)
}

Information regarding a detected signature on a page.

type nonrec signature_detection_list = signature_detection list
type nonrec lending_document = {
  1. signature_detections : signature_detection_list option;
    (*

    A list of signatures detected in a lending document.

    *)
  2. lending_fields : lending_field_list option;
    (*

    An array of LendingField objects.

    *)
}

Holds the structured data returned by AnalyzeDocument for lending documents.

type nonrec expense_type = {
  1. confidence : percent option;
    (*

    The confidence of accuracy, as a percentage.

    *)
  2. text : string_ option;
    (*

    The word or line of text detected by Amazon Textract.

    *)
}

An object used to store information about the Type detected by Amazon Textract.

type nonrec expense_detection = {
  1. confidence : percent option;
    (*

    The confidence in detection, as a percentage

    *)
  2. geometry : geometry option;
  3. text : string_ option;
    (*

    The word or line of text recognized by Amazon Textract

    *)
}

An object used to store information about the Value or Label detected by Amazon Textract.

type nonrec expense_currency = {
  1. confidence : percent option;
    (*

    Percentage confideence in the detected currency.

    *)
  2. code : string_ option;
    (*

    Currency code for detected currency. the current supported codes are:

    • USD
    • EUR
    • GBP
    • CAD
    • INR
    • JPY
    • CHF
    • AUD
    • CNY
    • BZR
    • SEK
    • HKD
    *)
}

Returns the kind of currency detected.

type nonrec string_list = string_ list
type nonrec expense_group_property = {
  1. id : string_ option;
    (*

    Provides a group Id number, which will be the same for each in the group.

    *)
  2. types : string_list option;
    (*

    Informs you on whether the expense group is a name or an address.

    *)
}

Shows the group that a certain key belongs to. This helps differentiate between names and addresses for different organizations, that can be hard to determine via JSON response.

type nonrec expense_group_property_list = expense_group_property list
type nonrec expense_field = {
  1. group_properties : expense_group_property_list option;
    (*

    Shows which group a response object belongs to, such as whether an address line belongs to the vendor's address or the recipent's address.

    *)
  2. currency : expense_currency option;
    (*

    Shows the kind of currency, both the code and confidence associated with any monatary value detected.

    *)
  3. page_number : u_integer option;
    (*

    The page number the value was detected on.

    *)
  4. value_detection : expense_detection option;
    (*

    The value of a detected element. Present in explicit and implicit elements.

    *)
  5. label_detection : expense_detection option;
    (*

    The explicitly stated label of a detected element.

    *)
  6. type_ : expense_type option;
    (*

    The implied label of a detected element. Present alongside LabelDetection for explicit elements.

    *)
}

Breakdown of detected information, seperated into the catagories Type, LabelDetection, and ValueDetection

type nonrec expense_field_list = expense_field list
type nonrec line_item_fields = {
  1. line_item_expense_fields : expense_field_list option;
    (*

    ExpenseFields used to show information from detected lines on a table.

    *)
}

A structure that holds information about the different lines found in a document's tables.

type nonrec line_item_list = line_item_fields list
type nonrec line_item_group = {
  1. line_items : line_item_list option;
    (*

    The breakdown of information on a particular line of a table.

    *)
  2. line_item_group_index : u_integer option;
    (*

    The number used to identify a specific table in a document. The first table encountered will have a LineItemGroupIndex of 1, the second 2, etc.

    *)
}

A grouping of tables which contain LineItems, with each table identified by the table's LineItemGroupIndex.

type nonrec line_item_group_list = line_item_group list
type nonrec block_type =
  1. | LAYOUT_KEY_VALUE
  2. | LAYOUT_TABLE
  3. | LAYOUT_FIGURE
  4. | LAYOUT_LIST
  5. | LAYOUT_PAGE_NUMBER
  6. | LAYOUT_SECTION_HEADER
  7. | LAYOUT_HEADER
  8. | LAYOUT_TITLE
  9. | LAYOUT_TEXT
  10. | TABLE_TITLE
  11. | SIGNATURE
  12. | QUERY_RESULT
  13. | QUERY
  14. | TITLE
  15. | MERGED_CELL
  16. | SELECTION_ELEMENT
  17. | CELL
  18. | TABLE
  19. | WORD
  20. | LINE
  21. | PAGE
  22. | KEY_VALUE_SET
type nonrec text_type =
  1. | PRINTED
  2. | HANDWRITING
type nonrec relationship_type =
  1. | TABLE_TITLE
  2. | TABLE
  3. | ANSWER
  4. | TITLE
  5. | MERGED_CELL
  6. | COMPLEX_FEATURES
  7. | CHILD
  8. | VALUE
type nonrec id_list = non_empty_string list
type nonrec relationship = {
  1. ids : id_list option;
    (*

    An array of IDs for related blocks. You can get the type of the relationship from the Type element.

    *)
  2. type_ : relationship_type option;
    (*

    The type of relationship between the blocks in the IDs array and the current block. The following list describes the relationship types that can be returned.

    • VALUE - A list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair.
    • CHILD - A list of IDs that identify blocks found within the current block object. For example, WORD blocks have a CHILD relationship to the LINE block type.
    • MERGED_CELL - A list of IDs that identify each of the MERGED_CELL block types in a table.
    • ANSWER - A list that contains the ID of the QUERY_RESULT block that’s associated with the corresponding QUERY block.
    • TABLE - A list of IDs that identify associated TABLE block types.
    • TABLE_TITLE - A list that contains the ID for the TABLE_TITLE block type in a table.
    • TABLE_FOOTER - A list of IDs that identify the TABLE_FOOTER block types in a table.
    *)
}

Information about how blocks are related to each other. A Block object contains 0 or more Relation objects in a list, Relationships. For more information, see Block.

The Type element provides the type of the relationship for all blocks in the IDs array.

type nonrec relationship_list = relationship list
type nonrec entity_type =
  1. | SEMI_STRUCTURED_TABLE
  2. | STRUCTURED_TABLE
  3. | TABLE_SUMMARY
  4. | TABLE_SECTION_TITLE
  5. | TABLE_TITLE
  6. | COLUMN_HEADER
  7. | VALUE
  8. | KEY
type nonrec entity_types = entity_type list
type nonrec block = {
  1. query : query option;
  2. page : u_integer option;
    (*

    The page on which a block was detected. Page is returned by synchronous and asynchronous operations. Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned image (JPEG/PNG) provided to an asynchronous operation, even if it contains multiple document pages, is considered a single-page document. This means that for scanned images the value of Page is always 1.

    *)
  3. selection_status : selection_status option;
    (*

    The selection status of a selection element, such as an option button or check box.

    *)
  4. entity_types : entity_types option;
    (*

    The type of entity.

    The following entity types can be returned by FORMS analysis:

    • KEY - An identifier for a field on the document.
    • VALUE - The field text.

    The following entity types can be returned by TABLES analysis:

    • COLUMN_HEADER - Identifies a cell that is a header of a column.
    • TABLE_TITLE - Identifies a cell that is a title within the table.
    • TABLE_SECTION_TITLE - Identifies a cell that is a title of a section within a table. A section title is a cell that typically spans an entire row above a section.
    • TABLE_FOOTER - Identifies a cell that is a footer of a table.
    • TABLE_SUMMARY - Identifies a summary cell of a table. A summary cell can be a row of a table or an additional, smaller table that contains summary information for another table.
    • STRUCTURED_TABLE - Identifies a table with column headers where the content of each row corresponds to the headers.
    • SEMI_STRUCTURED_TABLE - Identifies a non-structured table.

    EntityTypes isn't returned by DetectDocumentText and GetDocumentTextDetection.

    *)
  5. relationships : relationship_list option;
    (*

    A list of relationship objects that describe how blocks are related to each other. For example, a LINE block object contains a CHILD relationship type with the WORD blocks that make up the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks.

    *)
  6. id : non_empty_string option;
    (*

    The identifier for the recognized text. The identifier is only unique for a single operation.

    *)
  7. geometry : geometry option;
    (*

    The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information.

    *)
  8. column_span : u_integer option;
    (*

    The number of columns that a table cell spans. ColumnSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.

    *)
  9. row_span : u_integer option;
    (*

    The number of rows that a table cell spans. RowSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.

    *)
  10. column_index : u_integer option;
    (*

    The column in which a table cell appears. The first column position is 1. ColumnIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.

    *)
  11. row_index : u_integer option;
    (*

    The row in which a table cell is located. The first row position is 1. RowIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.

    *)
  12. text_type : text_type option;
    (*

    The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text.

    *)
  13. text : string_ option;
    (*

    The word or line of text that's recognized by Amazon Textract.

    *)
  14. confidence : percent option;
    (*

    The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.

    *)
  15. block_type : block_type option;
    (*

    The type of text item that's recognized. In operations for text detection, the following types are returned:

    • PAGE - Contains a list of the LINE Block objects that are detected on a document page.
    • WORD - A word 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 space-delimited, contiguous words that are detected on a document page.

    In text analysis operations, the following types are returned:

    • PAGE - Contains a list of child Block objects that are detected on a document page.
    • KEY_VALUE_SET - Stores the KEY and VALUE Block objects for linked text that's detected on a document page. Use the EntityType field to determine if a KEY_VALUE_SET object is a KEY Block object or a VALUE Block object.
    • 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.
    • TABLE - A table that's detected on a document page. A table is grid-based information with two or more rows or columns, with a cell span of one row and one column each.
    • TABLE_TITLE - The title of a table. A title is typically a line of text above or below a table, or embedded as the first row of a table.
    • TABLE_FOOTER - The footer associated with a table. A footer is typically a line or lines of text below a table or embedded as the last row of a table.
    • CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the cell.
    • MERGED_CELL - A cell in a table whose content spans more than one row or column. The Relationships array for this cell contain data from individual cells.
    • SELECTION_ELEMENT - A selection element such as an option button (radio button) or a check box that's detected on a document page. Use the value of SelectionStatus to determine the status of the selection element.
    • SIGNATURE - The location and confidence score of a signature detected on a document page. Can be returned as part of a Key-Value pair or a detected cell.
    • QUERY - A question asked during the call of AnalyzeDocument. Contains an alias and an ID that attaches it to its answer.
    • QUERY_RESULT - A response to a question asked during the call of analyze document. Comes with an alias and ID for ease of locating in a response. Also contains location and confidence score.

    The following BlockTypes are only returned for Amazon Textract Layout.

    • LAYOUT_TITLE - The main title of the document.
    • LAYOUT_HEADER - Text located in the top margin of the document.
    • LAYOUT_FOOTER - Text located in the bottom margin of the document.
    • LAYOUT_SECTION_HEADER - The titles of sections within a document.
    • LAYOUT_PAGE_NUMBER - The page number of the documents.
    • LAYOUT_LIST - Any information grouped together in list form.
    • LAYOUT_FIGURE - Indicates the location of an image in a document.
    • LAYOUT_TABLE - Indicates the location of a table in the document.
    • LAYOUT_KEY_VALUE - Indicates the location of form key-values in a document.
    • LAYOUT_TEXT - Text that is present typically as a part of paragraphs in documents.
    *)
}

A Block represents items that are recognized in a document within a group of pixels close to each other. The information returned in a Block object depends on the type of operation. In text detection for documents (for example DetectDocumentText), you get information about the detected words and lines of text. In text analysis (for example AnalyzeDocument), you can also get information about the fields, tables, and selection elements that are detected in the document.

An array of Block objects is returned by both synchronous and asynchronous operations. In synchronous operations, such as DetectDocumentText, the array of Block objects is the entire set of results. In asynchronous operations, such as GetDocumentAnalysis, the array is returned over one or more responses.

For more information, see How Amazon Textract Works.

type nonrec block_list = block list
type nonrec expense_document = {
  1. blocks : block_list option;
    (*

    This is a block object, the same as reported when DetectDocumentText is run on a document. It provides word level recognition of text.

    *)
  2. line_item_groups : line_item_group_list option;
    (*

    Information detected on each table of a document, seperated into LineItems.

    *)
  3. summary_fields : expense_field_list option;
    (*

    Any information found outside of a table by Amazon Textract.

    *)
  4. expense_index : u_integer option;
    (*

    Denotes which invoice or receipt in the document the information is coming from. First document will be 1, the second 2, and so on.

    *)
}

The structure holding all the information returned by AnalyzeExpense

type nonrec normalized_value = {
  1. value_type : value_type option;
    (*

    The normalized type of the value detected. In this case, DATE.

    *)
  2. value : string_ option;
    (*

    The value of the date, written as Year-Month-DayTHour:Minute:Second.

    *)
}

Contains information relating to dates in a document, including the type of value, and the value.

type nonrec analyze_id_detections = {
  1. confidence : percent option;
    (*

    The confidence score of the detected text.

    *)
  2. normalized_value : normalized_value option;
    (*

    Only returned for dates, returns the type of value detected and the date written in a more machine readable way.

    *)
  3. text : string_;
    (*

    Text of either the normalized field or value associated with it.

    *)
}

Used to contain the information detected by an AnalyzeID operation.

type nonrec identity_document_field = {
  1. value_detection : analyze_id_detections option;
  2. type_ : analyze_id_detections option;
}

Structure containing both the normalized type of the extracted information and the text associated with it. These are extracted as Type and Value respectively.

type nonrec identity_document_field_list = identity_document_field list
type nonrec identity_document = {
  1. blocks : block_list option;
    (*

    Individual word recognition, as returned by document detection.

    *)
  2. identity_document_fields : identity_document_field_list option;
    (*

    The structure used to record information extracted from identity documents. Contains both normalized field and value of the extracted text.

    *)
  3. document_index : u_integer option;
    (*

    Denotes the placement of a document in the IdentityDocument list. The first document is marked 1, the second 2 and so on.

    *)
}

The structure that lists each document processed in an AnalyzeID operation.

type nonrec extraction = {
  1. identity_document : identity_document option;
  2. expense_document : expense_document option;
  3. lending_document : lending_document option;
    (*

    Holds the structured data returned by AnalyzeDocument for lending documents.

    *)
}

Contains information extracted by an analysis operation after using StartLendingAnalysis.

type nonrec extraction_list = extraction list
type nonrec lending_result = {
  1. extractions : extraction_list option;
    (*

    An array of Extraction to hold structured data. e.g. normalized key value pairs instead of raw OCR detections .

    *)
  2. page_classification : page_classification option;
    (*

    The classifier result for a given page.

    *)
  3. page : u_integer option;
    (*

    The page number for a page, with regard to whole submission.

    *)
}

Contains the detections for each page analyzed through the Analyze Lending API.

type nonrec lending_result_list = lending_result list
type nonrec get_lending_analysis_response = {
  1. analyze_lending_model_version : string_ option;
    (*

    The current model version of the Analyze Lending API.

    *)
  2. status_message : status_message option;
    (*

    Returns if the lending analysis job could not be completed. Contains explanation for what error occurred.

    *)
  3. warnings : warnings option;
    (*

    A list of warnings that occurred during the lending analysis operation.

    *)
  4. results : lending_result_list option;
    (*

    Holds the information returned by one of AmazonTextract's document analysis operations for the pinstripe.

    *)
  5. next_token : pagination_token option;
    (*

    If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of lending results.

    *)
  6. job_status : job_status option;
    (*

    The current status of the lending analysis job.

    *)
  7. document_metadata : document_metadata option;
}
type nonrec get_lending_analysis_request = {
  1. next_token : pagination_token option;
    (*

    If the previous response was incomplete, Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of lending results.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return per paginated call. The largest value that you can specify is 30. If you specify a value greater than 30, a maximum of 30 results is returned. The default value is 30.

    *)
  3. job_id : job_id;
    (*

    A unique identifier for the lending or text-detection job. The JobId is returned from StartLendingAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec expense_document_list = expense_document list
type nonrec get_expense_analysis_response = {
  1. analyze_expense_model_version : string_ option;
    (*

    The current model version of AnalyzeExpense.

    *)
  2. status_message : status_message option;
    (*

    Returns if the detection job could not be completed. Contains explanation for what error occured.

    *)
  3. warnings : warnings option;
    (*

    A list of warnings that occurred during the text-detection operation for the document.

    *)
  4. expense_documents : expense_document_list option;
    (*

    The expenses detected by Amazon Textract.

    *)
  5. next_token : pagination_token option;
    (*

    If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.

    *)
  6. job_status : job_status option;
    (*

    The current status of the text detection job.

    *)
  7. document_metadata : document_metadata option;
    (*

    Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract operation.

    *)
}
type nonrec get_expense_analysis_request = {
  1. next_token : pagination_token option;
    (*

    If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return per paginated call. The largest value you can specify is 20. If you specify a value greater than 20, a maximum of 20 results is returned. The default value is 20.

    *)
  3. job_id : job_id;
    (*

    A unique identifier for the text detection job. The JobId is returned from StartExpenseAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec get_document_text_detection_response = {
  1. detect_document_text_model_version : string_ option;
  2. status_message : status_message option;
    (*

    Returns if the detection job could not be completed. Contains explanation for what error occured.

    *)
  3. warnings : warnings option;
    (*

    A list of warnings that occurred during the text-detection operation for the document.

    *)
  4. blocks : block_list option;
    (*

    The results of the text-detection operation.

    *)
  5. next_token : pagination_token option;
    (*

    If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.

    *)
  6. job_status : job_status option;
    (*

    The current status of the text detection job.

    *)
  7. document_metadata : document_metadata option;
    (*

    Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.

    *)
}
type nonrec get_document_text_detection_request = {
  1. next_token : pagination_token option;
    (*

    If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.

    *)
  3. job_id : job_id;
    (*

    A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection. A JobId value is only valid for 7 days.

    *)
}
type nonrec get_document_analysis_response = {
  1. analyze_document_model_version : string_ option;
  2. status_message : status_message option;
    (*

    Returns if the detection job could not be completed. Contains explanation for what error occured.

    *)
  3. warnings : warnings option;
    (*

    A list of warnings that occurred during the document-analysis operation.

    *)
  4. blocks : block_list option;
    (*

    The results of the text-analysis operation.

    *)
  5. next_token : pagination_token option;
    (*

    If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.

    *)
  6. job_status : job_status option;
    (*

    The current status of the text detection job.

    *)
  7. document_metadata : document_metadata option;
    (*

    Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.

    *)
}
type nonrec get_document_analysis_request = {
  1. next_token : pagination_token option;
    (*

    If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.

    *)
  2. max_results : max_results option;
    (*

    The maximum number of results to return per paginated call. The largest value that you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.

    *)
  3. job_id : job_id;
    (*

    A unique identifier for the text-detection job. The JobId is returned from StartDocumentAnalysis. A JobId value is only valid for 7 days.

    *)
}
type nonrec adapter_version_dataset_config = {
  1. manifest_s3_object : s3_object option;
}

The dataset configuration options for a given version of an adapter. Can include an Amazon S3 bucket if specified.

type nonrec evaluation_metric = {
  1. recall : float_ option;
    (*

    The Recall score for an adapter version.

    *)
  2. precision : float_ option;
    (*

    The Precision score for an adapter version.

    *)
  3. f1_score : float_ option;
    (*

    The F1 score for an adapter version.

    *)
}

The evaluation metrics (F1 score, Precision, and Recall) for an adapter version.

type nonrec adapter_version_evaluation_metric = {
  1. feature_type : feature_type option;
    (*

    Indicates the feature type being analyzed by a given adapter version.

    *)
  2. adapter_version : evaluation_metric option;
    (*

    The F1 score, precision, and recall metrics for the baseline model.

    *)
  3. baseline : evaluation_metric option;
    (*

    The F1 score, precision, and recall metrics for the baseline model.

    *)
}

Contains information on the metrics used to evalute the peformance of a given adapter version. Includes data for baseline model performance and individual adapter version perfromance.

type nonrec adapter_version_evaluation_metrics = adapter_version_evaluation_metric list
type nonrec get_adapter_version_response = {
  1. tags : tag_map option;
    (*

    A set of tags (key-value pairs) that are associated with the adapter version.

    *)
  2. evaluation_metrics : adapter_version_evaluation_metrics option;
    (*

    The evaluation metrics (F1 score, Precision, and Recall) for the requested version, grouped by baseline metrics and adapter version.

    *)
  3. output_config : output_config option;
  4. kms_key_id : kms_key_id option;
    (*

    The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.

    *)
  5. dataset_config : adapter_version_dataset_config option;
    (*

    Specifies a dataset used to train a new adapter version. Takes a ManifestS3Objec as the value.

    *)
  6. status_message : adapter_version_status_message option;
    (*

    A message that describes the status of the requested adapter version.

    *)
  7. status : adapter_version_status option;
    (*

    The status of the adapter version that has been requested.

    *)
  8. feature_types : feature_types option;
    (*

    List of the targeted feature types for the requested adapter version.

    *)
  9. creation_time : date_time option;
    (*

    The time that the adapter version was created.

    *)
  10. adapter_version : adapter_version option;
    (*

    A string containing the adapter version that has been retrieved.

    *)
  11. adapter_id : adapter_id option;
    (*

    A string containing a unique ID for the adapter version being retrieved.

    *)
}
type nonrec get_adapter_version_request = {
  1. adapter_version : adapter_version;
    (*

    A string specifying the adapter version you want to retrieve information for.

    *)
  2. adapter_id : adapter_id;
    (*

    A string specifying a unique ID for the adapter version you want to retrieve information for.

    *)
}
type nonrec get_adapter_response = {
  1. tags : tag_map option;
    (*

    A set of tags (key-value pairs) associated with the adapter that has been retrieved.

    *)
  2. auto_update : auto_update option;
    (*

    Binary value indicating if the adapter is being automatically updated or not.

    *)
  3. feature_types : feature_types option;
    (*

    List of the targeted feature types for the requested adapter.

    *)
  4. description : adapter_description option;
    (*

    The description for the requested adapter.

    *)
  5. creation_time : date_time option;
    (*

    The date and time the requested adapter was created at.

    *)
  6. adapter_name : adapter_name option;
    (*

    The name of the requested adapter.

    *)
  7. adapter_id : adapter_id option;
    (*

    A string identifying the adapter that information has been retrieved for.

    *)
}
type nonrec get_adapter_request = {
  1. adapter_id : adapter_id;
    (*

    A string containing a unique ID for the adapter.

    *)
}
type nonrec detect_document_text_response = {
  1. detect_document_text_model_version : string_ option;
  2. blocks : block_list option;
    (*

    An array of Block objects that contain the text that's detected in the document.

    *)
  3. document_metadata : document_metadata option;
    (*

    Metadata about the document. It contains the number of pages that are detected in the document.

    *)
}
type nonrec image_blob = bytes
type nonrec document = {
  1. s3_object : s3_object option;
    (*

    Identifies an S3 object as the document source. The maximum size of a document that's stored in an S3 bucket is 5 MB.

    *)
  2. bytes : image_blob option;
    (*

    A blob of base64-encoded document bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPEG format.

    If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.

    *)
}

The input document, either as bytes or as an S3 object.

You pass image bytes to an Amazon Textract API operation by using the Bytes property. For example, you would use the Bytes property to pass a document loaded from a local file system. Image bytes passed by using the Bytes property must be base64 encoded. Your code might not need to encode document file bytes if you're using an AWS SDK to call Amazon Textract API operations.

You pass images stored in an S3 bucket to an Amazon Textract API operation by using the S3Object property. Documents stored in an S3 bucket don't need to be base64 encoded.

The AWS Region for the S3 bucket that contains the S3 object must match the AWS Region that you use for Amazon Textract operations.

If you use the AWS CLI to call Amazon Textract operations, passing image bytes using the Bytes property isn't supported. You must first upload the document to an Amazon S3 bucket, and then call the operation using the S3Object property.

For Amazon Textract to process an S3 object, the user must have permission to access the S3 object.

type nonrec detect_document_text_request = {
  1. document : document;
    (*

    The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG or PNG format.

    If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the Bytes field.

    *)
}
type nonrec delete_adapter_version_response = unit
type nonrec delete_adapter_version_request = {
  1. adapter_version : adapter_version;
    (*

    Specifies the adapter version to be deleted.

    *)
  2. adapter_id : adapter_id;
    (*

    A string containing a unique ID for the adapter version that will be deleted.

    *)
}
type nonrec delete_adapter_response = unit
type nonrec delete_adapter_request = {
  1. adapter_id : adapter_id;
    (*

    A string containing a unique ID for the adapter to be deleted.

    *)
}
type nonrec create_adapter_version_response = {
  1. adapter_version : adapter_version option;
    (*

    A string describing the new version of the adapter.

    *)
  2. adapter_id : adapter_id option;
    (*

    A string containing the unique ID for the adapter that has received a new version.

    *)
}
type nonrec create_adapter_version_request = {
  1. tags : tag_map option;
    (*

    A set of tags (key-value pairs) that you want to attach to the adapter version.

    *)
  2. output_config : output_config;
  3. kms_key_id : kms_key_id option;
    (*

    The identifier for your AWS Key Management Service key (AWS KMS key). Used to encrypt your documents.

    *)
  4. dataset_config : adapter_version_dataset_config;
    (*

    Specifies a dataset used to train a new adapter version. Takes a ManifestS3Object as the value.

    *)
  5. client_request_token : client_request_token option;
    (*

    Idempotent token is used to recognize the request. If the same token is used with multiple CreateAdapterVersion requests, the same session is returned. This token is employed to avoid unintentionally creating the same session multiple times.

    *)
  6. adapter_id : adapter_id;
    (*

    A string containing a unique ID for the adapter that will receive a new version.

    *)
}
type nonrec create_adapter_response = {
  1. adapter_id : adapter_id option;
    (*

    A string containing the unique ID for the adapter that has been created.

    *)
}
type nonrec create_adapter_request = {
  1. tags : tag_map option;
    (*

    A list of tags to be added to the adapter.

    *)
  2. auto_update : auto_update option;
    (*

    Controls whether or not the adapter should automatically update.

    *)
  3. feature_types : feature_types;
    (*

    The type of feature that the adapter is being trained on. Currrenly, supported feature types are: QUERIES

    *)
  4. description : adapter_description option;
    (*

    The description to be assigned to the adapter being created.

    *)
  5. client_request_token : client_request_token option;
    (*

    Idempotent token is used to recognize the request. If the same token is used with multiple CreateAdapter requests, the same session is returned. This token is employed to avoid unintentionally creating the same session multiple times.

    *)
  6. adapter_name : adapter_name;
    (*

    The name to be assigned to the adapter being created.

    *)
}
type nonrec identity_document_list = identity_document list
type nonrec analyze_id_response = {
  1. analyze_id_model_version : string_ option;
    (*

    The version of the AnalyzeIdentity API being used to process documents.

    *)
  2. document_metadata : document_metadata option;
  3. identity_documents : identity_document_list option;
    (*

    The list of documents processed by AnalyzeID. Includes a number denoting their place in the list and the response structure for the document.

    *)
}
type nonrec document_pages = document list
type nonrec analyze_id_request = {
  1. document_pages : document_pages;
    (*

    The document being passed to AnalyzeID.

    *)
}
type nonrec analyze_expense_response = {
  1. expense_documents : expense_document_list option;
    (*

    The expenses detected by Amazon Textract.

    *)
  2. document_metadata : document_metadata option;
}
type nonrec analyze_expense_request = {
  1. document : document;
}
type nonrec human_loop_quota_exceeded_exception = {
  1. code : string_ option;
  2. message : string_ option;
  3. service_code : string_ option;
    (*

    The service code.

    *)
  4. quota_code : string_ option;
    (*

    The quota code.

    *)
  5. resource_type : string_ option;
    (*

    The resource type.

    *)
}

Indicates you have exceeded the maximum number of active human in the loop workflows available

type nonrec human_loop_arn = string
type nonrec human_loop_activation_reason = string
type nonrec human_loop_activation_reasons = human_loop_activation_reason list
type nonrec synthesized_json_human_loop_activation_conditions_evaluation_results = string
type nonrec human_loop_activation_output = {
  1. human_loop_activation_conditions_evaluation_results : synthesized_json_human_loop_activation_conditions_evaluation_results option;
    (*

    Shows the result of condition evaluations, including those conditions which activated a human review.

    *)
  2. human_loop_activation_reasons : human_loop_activation_reasons option;
    (*

    Shows if and why human review was needed.

    *)
  3. human_loop_arn : human_loop_arn option;
    (*

    The Amazon Resource Name (ARN) of the HumanLoop created.

    *)
}

Shows the results of the human in the loop evaluation. If there is no HumanLoopArn, the input did not trigger human review.

type nonrec analyze_document_response = {
  1. analyze_document_model_version : string_ option;
    (*

    The version of the model used to analyze the document.

    *)
  2. human_loop_activation_output : human_loop_activation_output option;
    (*

    Shows the results of the human in the loop evaluation.

    *)
  3. blocks : block_list option;
    (*

    The items that are detected and analyzed by AnalyzeDocument.

    *)
  4. document_metadata : document_metadata option;
    (*

    Metadata about the analyzed document. An example is the number of pages.

    *)
}
type nonrec human_loop_name = string
type nonrec flow_definition_arn = string
type nonrec content_classifier =
  1. | FREE_OF_ADULT_CONTENT
  2. | FREE_OF_PERSONALLY_IDENTIFIABLE_INFORMATION
type nonrec content_classifiers = content_classifier list
type nonrec human_loop_data_attributes = {
  1. content_classifiers : content_classifiers option;
    (*

    Sets whether the input image is free of personally identifiable information or adult content.

    *)
}

Allows you to set attributes of the image. Currently, you can declare an image as free of personally identifiable information and adult content.

type nonrec human_loop_config = {
  1. data_attributes : human_loop_data_attributes option;
    (*

    Sets attributes of the input data.

    *)
  2. flow_definition_arn : flow_definition_arn;
    (*

    The Amazon Resource Name (ARN) of the flow definition.

    *)
  3. human_loop_name : human_loop_name;
    (*

    The name of the human workflow used for this image. This should be kept unique within a region.

    *)
}

Sets up the human review workflow the document will be sent to if one of the conditions is met. You can also set certain attributes of the image before review.

type nonrec analyze_document_request = {
  1. adapters_config : adapters_config option;
    (*

    Specifies the adapter to be used when analyzing a document.

    *)
  2. queries_config : queries_config option;
    (*

    Contains Queries and the alias for those Queries, as determined by the input.

    *)
  3. human_loop_config : human_loop_config option;
    (*

    Sets the configuration for the human in the loop workflow for analyzing documents.

    *)
  4. feature_types : feature_types;
    (*

    A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected form data. Add SIGNATURES to return the locations of detected signatures. Add LAYOUT to the list to return information about the layout of the document. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).

    *)
  5. document : document;
    (*

    The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPEG, PNG, PDF, or TIFF format.

    If you're using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes that are passed using the Bytes field.

    *)
}