amazonka-textract-2.0: Amazon Textract SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Textract.AnalyzeDocument

Description

Analyzes an input document for relationships between detected items.

The types of information returned are as follows:

  • Form data (key-value pairs). The related information is returned in two Block objects, each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, /Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina/ is the value.
  • Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table.
  • Lines and words of text. A LINE Block object contains one or more WORD Block objects. All lines and words that are detected in the document are returned (including text that doesn't have a relationship with the value of FeatureTypes).
  • Signatures. A SIGNATURE Block object contains the location information of a signature in a document. If used in conjunction with forms or tables, a signature can be given a Key-Value pairing or be detected in the cell of a table.
  • Query. A QUERY Block object contains the query text, alias and link to the associated Query results block object.
  • Query Result. A QUERY_RESULT Block object contains the answer to the query and an ID that connects it to the query asked. This Block also contains a confidence score.

Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables. A SELECTION_ELEMENT Block object contains information about a selection element, including the selection status.

You can choose which type of analysis to perform by specifying the FeatureTypes list.

The output is returned in a list of Block objects.

AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.

For more information, see Document Text Analysis.

Synopsis

Creating a Request

data AnalyzeDocument Source #

See: newAnalyzeDocument smart constructor.

Constructors

AnalyzeDocument' 

Fields

  • humanLoopConfig :: Maybe HumanLoopConfig

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

  • queriesConfig :: Maybe QueriesConfig

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

  • 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.

  • featureTypes :: [FeatureType]

    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. To perform both forms and table analysis, add TABLES and FORMS to FeatureTypes. To detect signatures within form data and table data, add SIGNATURES to either TABLES or FORMS. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).

Instances

Instances details
ToJSON AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

ToHeaders AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

ToPath AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

ToQuery AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

AWSRequest AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type AWSResponse AnalyzeDocument #

Generic AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type Rep AnalyzeDocument :: Type -> Type #

Read AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Show AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

NFData AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Methods

rnf :: AnalyzeDocument -> () #

Eq AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Hashable AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type AWSResponse AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocument = D1 ('MetaData "AnalyzeDocument" "Amazonka.Textract.AnalyzeDocument" "amazonka-textract-2.0-6i5mJlqzS4xCepXxXFK6UK" 'False) (C1 ('MetaCons "AnalyzeDocument'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "humanLoopConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe HumanLoopConfig)) :*: S1 ('MetaSel ('Just "queriesConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe QueriesConfig))) :*: (S1 ('MetaSel ('Just "document") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Document) :*: S1 ('MetaSel ('Just "featureTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [FeatureType]))))

newAnalyzeDocument Source #

Create a value of AnalyzeDocument 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:humanLoopConfig:AnalyzeDocument', analyzeDocument_humanLoopConfig - Sets the configuration for the human in the loop workflow for analyzing documents.

$sel:queriesConfig:AnalyzeDocument', analyzeDocument_queriesConfig - Contains Queries and the alias for those Queries, as determined by the input.

$sel:document:AnalyzeDocument', analyzeDocument_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.

$sel:featureTypes:AnalyzeDocument', analyzeDocument_featureTypes - 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. To perform both forms and table analysis, add TABLES and FORMS to FeatureTypes. To detect signatures within form data and table data, add SIGNATURES to either TABLES or FORMS. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).

Request Lenses

analyzeDocument_humanLoopConfig :: Lens' AnalyzeDocument (Maybe HumanLoopConfig) Source #

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

analyzeDocument_queriesConfig :: Lens' AnalyzeDocument (Maybe QueriesConfig) Source #

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

analyzeDocument_document :: Lens' AnalyzeDocument Document Source #

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.

analyzeDocument_featureTypes :: Lens' AnalyzeDocument [FeatureType] Source #

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. To perform both forms and table analysis, add TABLES and FORMS to FeatureTypes. To detect signatures within form data and table data, add SIGNATURES to either TABLES or FORMS. All lines and words detected in the document are included in the response (including text that isn't related to the value of FeatureTypes).

Destructuring the Response

data AnalyzeDocumentResponse Source #

See: newAnalyzeDocumentResponse smart constructor.

Constructors

AnalyzeDocumentResponse' 

Fields

Instances

Instances details
Generic AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type Rep AnalyzeDocumentResponse :: Type -> Type #

Read AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Show AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

NFData AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Methods

rnf :: AnalyzeDocumentResponse -> () #

Eq AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocumentResponse = D1 ('MetaData "AnalyzeDocumentResponse" "Amazonka.Textract.AnalyzeDocument" "amazonka-textract-2.0-6i5mJlqzS4xCepXxXFK6UK" 'False) (C1 ('MetaCons "AnalyzeDocumentResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "analyzeDocumentModelVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Block]))) :*: (S1 ('MetaSel ('Just "documentMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DocumentMetadata)) :*: (S1 ('MetaSel ('Just "humanLoopActivationOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe HumanLoopActivationOutput)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newAnalyzeDocumentResponse Source #

Create a value of AnalyzeDocumentResponse 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:analyzeDocumentModelVersion:AnalyzeDocumentResponse', analyzeDocumentResponse_analyzeDocumentModelVersion - The version of the model used to analyze the document.

AnalyzeDocumentResponse, analyzeDocumentResponse_blocks - The items that are detected and analyzed by AnalyzeDocument.

$sel:documentMetadata:AnalyzeDocumentResponse', analyzeDocumentResponse_documentMetadata - Metadata about the analyzed document. An example is the number of pages.

$sel:humanLoopActivationOutput:AnalyzeDocumentResponse', analyzeDocumentResponse_humanLoopActivationOutput - Shows the results of the human in the loop evaluation.

$sel:httpStatus:AnalyzeDocumentResponse', analyzeDocumentResponse_httpStatus - The response's http status code.

Response Lenses

analyzeDocumentResponse_analyzeDocumentModelVersion :: Lens' AnalyzeDocumentResponse (Maybe Text) Source #

The version of the model used to analyze the document.

analyzeDocumentResponse_blocks :: Lens' AnalyzeDocumentResponse (Maybe [Block]) Source #

The items that are detected and analyzed by AnalyzeDocument.

analyzeDocumentResponse_documentMetadata :: Lens' AnalyzeDocumentResponse (Maybe DocumentMetadata) Source #

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