Gets summarized results for the StartLendingAnalysis operation, which analyzes text in a lending document. The returned summary consists of information about documents grouped together by a common document type. Information like detected signatures, page numbers, and split documents is returned with respect to the type of grouped document.
You start asynchronous text analysis by calling StartLendingAnalysis, which returns a job identifier (JobId). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartLendingAnalysis.
To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetLendingAnalysisSummary, and pass the job identifier (JobId) from the initial call to StartLendingAnalysis.
Parameters:
-
job_id
(JobId)
–
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.
Raises:
-
AccessDeniedException
–
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.
-
InternalServerError
–
Amazon Textract experienced a service issue. Try your call again.
-
InvalidJobIdException
–
An invalid job identifier was passed to an asynchronous analysis operation.
-
InvalidKMSKeyException
–
Indicates you do not have decrypt permissions with the KMS key entered, or the KMS key was entered incorrectly.
-
InvalidParameterException
–
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.
-
InvalidS3ObjectException
–
-
ProvisionedThroughputExceededException
–
The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Textract.
-
ThrottlingException
–
Amazon Textract is temporarily unable to process the request. Try your call again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_textract/_services/textract.py
| def get_lending_analysis_summary(
self,
job_id: "capo_textract.types.job_id.JobId",
*,
config_overrides: Optional[TextractClientConfig] = None,
) -> "capo_textract.types.get_lending_analysis_summary_response.GetLendingAnalysisSummaryResponse":
"""<p>Gets summarized results for the <code>StartLendingAnalysis</code> operation, which analyzes text in a lending document. The returned summary consists of information about documents grouped together by a common document type. Information like detected signatures, page numbers, and split documents is returned with respect to the type of grouped document. </p> <p>You start asynchronous text analysis by calling <code>StartLendingAnalysis</code>, which returns a job identifier (<code>JobId</code>). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to <code>StartLendingAnalysis</code>. </p> <p>To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call <code>GetLendingAnalysisSummary</code>, and pass the job identifier (<code>JobId</code>) from the initial call to <code>StartLendingAnalysis</code>.</p>
Args:
job_id: <p> A unique identifier for the lending or text-detection job. The <code>JobId</code> is returned from StartLendingAnalysis. A <code>JobId</code> value is only valid for 7 days.</p>
Raises:
capo_textract.errors.access_denied_exception.AccessDeniedException: <p>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.</p>
capo_textract.errors.internal_server_error.InternalServerError: <p>Amazon Textract experienced a service issue. Try your call again.</p>
capo_textract.errors.invalid_job_id_exception.InvalidJobIdException: <p>An invalid job identifier was passed to an asynchronous analysis operation.</p>
capo_textract.errors.invalid_kms_key_exception.InvalidKMSKeyException: <p> Indicates you do not have decrypt permissions with the KMS key entered, or the KMS key was entered incorrectly. </p>
capo_textract.errors.invalid_parameter_exception.InvalidParameterException: <p>An input parameter violated a constraint. For example, in synchronous operations, an <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your parameter before calling the API operation again.</p>
capo_textract.errors.invalid_s3_object_exception.InvalidS3ObjectException: <p>Amazon Textract is unable to access the S3 object that's specified in the request. for more information, <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Configure Access to Amazon S3</a> For troubleshooting information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/troubleshooting.html">Troubleshooting Amazon S3</a> </p>
capo_textract.errors.provisioned_throughput_exceeded_exception.ProvisionedThroughputExceededException: <p>The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Textract.</p>
capo_textract.errors.throttling_exception.ThrottlingException: <p>Amazon Textract is temporarily unable to process the request. Try your call again.</p>
capo_textract.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_textract.types.get_lending_analysis_summary_request.GetLendingAnalysisSummaryRequest]",
) -> OperationResponse[
"capo_textract.types.get_lending_analysis_summary_response.GetLendingAnalysisSummaryResponse"
]:
import capo_textract._operations.textract.get_lending_analysis_summary
output, http_response = (
capo_textract._operations.textract.get_lending_analysis_summary.get_lending_analysis_summary(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetLendingAnalysisSummary")
)
input_: capo_textract.types.get_lending_analysis_summary_request.GetLendingAnalysisSummaryRequest = {
"job_id": job_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|