libZSservicesZSamazonka-textractZSamazonka-textract
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

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.

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

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

Instances

Instances details
Eq AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Read AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Show AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Generic AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type Rep AnalyzeDocument :: Type -> Type #

NFData AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Methods

rnf :: AnalyzeDocument -> () #

Hashable AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

ToJSON AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

AWSRequest AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type AWSResponse 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

type Rep AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocument = D1 ('MetaData "AnalyzeDocument" "Amazonka.Textract.AnalyzeDocument" "libZSservicesZSamazonka-textractZSamazonka-textract" 'False) (C1 ('MetaCons "AnalyzeDocument'" 'PrefixI 'True) (S1 ('MetaSel ('Just "humanLoopConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe HumanLoopConfig)) :*: (S1 ('MetaSel ('Just "document") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Document) :*: S1 ('MetaSel ('Just "featureTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [FeatureType]))))
type AWSResponse AnalyzeDocument Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

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

$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. 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).

Request Lenses

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

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

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

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

Destructuring the Response

data AnalyzeDocumentResponse Source #

See: newAnalyzeDocumentResponse smart constructor.

Constructors

AnalyzeDocumentResponse' 

Fields

Instances

Instances details
Eq AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Read AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Show AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Generic AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Associated Types

type Rep AnalyzeDocumentResponse :: Type -> Type #

NFData AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

Methods

rnf :: AnalyzeDocumentResponse -> () #

type Rep AnalyzeDocumentResponse Source # 
Instance details

Defined in Amazonka.Textract.AnalyzeDocument

type Rep AnalyzeDocumentResponse = D1 ('MetaData "AnalyzeDocumentResponse" "Amazonka.Textract.AnalyzeDocument" "libZSservicesZSamazonka-textractZSamazonka-textract" 'False) (C1 ('MetaCons "AnalyzeDocumentResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "documentMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DocumentMetadata)) :*: S1 ('MetaSel ('Just "blocks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Block]))) :*: (S1 ('MetaSel ('Just "humanLoopActivationOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe HumanLoopActivationOutput)) :*: (S1 ('MetaSel ('Just "analyzeDocumentModelVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: 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:documentMetadata:AnalyzeDocumentResponse', analyzeDocumentResponse_documentMetadata - Metadata about the analyzed document. An example is the number of pages.

$sel:blocks:AnalyzeDocumentResponse', analyzeDocumentResponse_blocks - The items that are detected and analyzed by AnalyzeDocument.

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

$sel:analyzeDocumentModelVersion:AnalyzeDocumentResponse', analyzeDocumentResponse_analyzeDocumentModelVersion - The version of the model used to analyze the document.

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

Response Lenses

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

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

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

The items that are detected and analyzed by AnalyzeDocument.

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

The version of the model used to analyze the document.