Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.
You start asynchronous text detection by calling
StartDocumentTextDetection, which returns a job identifier (JobId
).
When the text detection 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
StartDocumentTextDetection
. To get the results of the text-detection
operation, first check that the status value published to the Amazon SNS
topic is SUCCEEDED
. If so, call GetDocumentTextDetection
, and pass
the job identifier (JobId
) from the initial call to
StartDocumentTextDetection
.
GetDocumentTextDetection
returns an array of Block objects.
Each document page has as an associated Block
of type PAGE. Each PAGE
Block
object is the parent of LINE Block
objects that represent the
lines of detected text on a page. A LINE Block
object is a parent for
each word that makes up the line. Words are represented by Block
objects of type WORD.
Use the MaxResults parameter to limit the number of blocks that are
returned. If there are more results than specified in MaxResults
, the
value of NextToken
in the operation response contains a pagination
token for getting the next set of results. To get the next page of
results, call GetDocumentTextDetection
, and populate the NextToken
request parameter with the token value that's returned from the
previous call to GetDocumentTextDetection
.
For more information, see Document Text Detection.
Synopsis
- data GetDocumentTextDetection = GetDocumentTextDetection' {}
- newGetDocumentTextDetection :: Text -> GetDocumentTextDetection
- getDocumentTextDetection_nextToken :: Lens' GetDocumentTextDetection (Maybe Text)
- getDocumentTextDetection_maxResults :: Lens' GetDocumentTextDetection (Maybe Natural)
- getDocumentTextDetection_jobId :: Lens' GetDocumentTextDetection Text
- data GetDocumentTextDetectionResponse = GetDocumentTextDetectionResponse' {}
- newGetDocumentTextDetectionResponse :: Int -> GetDocumentTextDetectionResponse
- getDocumentTextDetectionResponse_documentMetadata :: Lens' GetDocumentTextDetectionResponse (Maybe DocumentMetadata)
- getDocumentTextDetectionResponse_blocks :: Lens' GetDocumentTextDetectionResponse (Maybe [Block])
- getDocumentTextDetectionResponse_warnings :: Lens' GetDocumentTextDetectionResponse (Maybe [Warning])
- getDocumentTextDetectionResponse_nextToken :: Lens' GetDocumentTextDetectionResponse (Maybe Text)
- getDocumentTextDetectionResponse_statusMessage :: Lens' GetDocumentTextDetectionResponse (Maybe Text)
- getDocumentTextDetectionResponse_detectDocumentTextModelVersion :: Lens' GetDocumentTextDetectionResponse (Maybe Text)
- getDocumentTextDetectionResponse_jobStatus :: Lens' GetDocumentTextDetectionResponse (Maybe JobStatus)
- getDocumentTextDetectionResponse_httpStatus :: Lens' GetDocumentTextDetectionResponse Int
Creating a Request
data GetDocumentTextDetection Source #
See: newGetDocumentTextDetection
smart constructor.
GetDocumentTextDetection' | |
|
Instances
newGetDocumentTextDetection Source #
Create a value of GetDocumentTextDetection
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:nextToken:GetDocumentTextDetection'
, getDocumentTextDetection_nextToken
- 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.
$sel:maxResults:GetDocumentTextDetection'
, getDocumentTextDetection_maxResults
- 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.
$sel:jobId:GetDocumentTextDetection'
, getDocumentTextDetection_jobId
- A unique identifier for the text detection job. The JobId
is returned
from StartDocumentTextDetection
. A JobId
value is only valid for 7
days.
Request Lenses
getDocumentTextDetection_nextToken :: Lens' GetDocumentTextDetection (Maybe Text) Source #
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.
getDocumentTextDetection_maxResults :: Lens' GetDocumentTextDetection (Maybe Natural) Source #
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.
getDocumentTextDetection_jobId :: Lens' GetDocumentTextDetection Text Source #
A unique identifier for the text detection job. The JobId
is returned
from StartDocumentTextDetection
. A JobId
value is only valid for 7
days.
Destructuring the Response
data GetDocumentTextDetectionResponse Source #
See: newGetDocumentTextDetectionResponse
smart constructor.
GetDocumentTextDetectionResponse' | |
|
Instances
newGetDocumentTextDetectionResponse Source #
Create a value of GetDocumentTextDetectionResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:documentMetadata:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_documentMetadata
- Information about a document that Amazon Textract processed.
DocumentMetadata
is returned in every page of paginated responses from
an Amazon Textract video operation.
$sel:blocks:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_blocks
- The results of the text-detection operation.
$sel:warnings:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_warnings
- A list of warnings that occurred during the text-detection operation for
the document.
$sel:nextToken:GetDocumentTextDetection'
, getDocumentTextDetectionResponse_nextToken
- 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.
$sel:statusMessage:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_statusMessage
- Returns if the detection job could not be completed. Contains
explanation for what error occured.
$sel:detectDocumentTextModelVersion:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_detectDocumentTextModelVersion
-
$sel:jobStatus:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_jobStatus
- The current status of the text detection job.
$sel:httpStatus:GetDocumentTextDetectionResponse'
, getDocumentTextDetectionResponse_httpStatus
- The response's http status code.
Response Lenses
getDocumentTextDetectionResponse_documentMetadata :: Lens' GetDocumentTextDetectionResponse (Maybe DocumentMetadata) Source #
Information about a document that Amazon Textract processed.
DocumentMetadata
is returned in every page of paginated responses from
an Amazon Textract video operation.
getDocumentTextDetectionResponse_blocks :: Lens' GetDocumentTextDetectionResponse (Maybe [Block]) Source #
The results of the text-detection operation.
getDocumentTextDetectionResponse_warnings :: Lens' GetDocumentTextDetectionResponse (Maybe [Warning]) Source #
A list of warnings that occurred during the text-detection operation for the document.
getDocumentTextDetectionResponse_nextToken :: Lens' GetDocumentTextDetectionResponse (Maybe Text) Source #
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.
getDocumentTextDetectionResponse_statusMessage :: Lens' GetDocumentTextDetectionResponse (Maybe Text) Source #
Returns if the detection job could not be completed. Contains explanation for what error occured.
getDocumentTextDetectionResponse_detectDocumentTextModelVersion :: Lens' GetDocumentTextDetectionResponse (Maybe Text) Source #
getDocumentTextDetectionResponse_jobStatus :: Lens' GetDocumentTextDetectionResponse (Maybe JobStatus) Source #
The current status of the text detection job.
getDocumentTextDetectionResponse_httpStatus :: Lens' GetDocumentTextDetectionResponse Int Source #
The response's http status code.