Fluent builder for the options passed to an AWS Textract document analysis, configuring which features Textract runs and, for the queries feature, which questions to ask of the document. A new instance is obtained from the AWS manager and passed into the document analysis calls; the builder methods are chainable and each returns the same instance so a script can compose the request in a single expression.

Group: Builders


Methods

features(String feature, String features)

Returns: DocumentAnalysisBuilder

Adds one or more Textract analysis features to run against the document, such as TABLES, FORMS, QUERIES or SIGNATURES. Blank values for the first argument are ignored; the feature list is created on first use.

ParameterDescription
featurethe primary feature to enable, ignored if blank
featuresany additional features to enable

query(String alias, String queryText, String pages)

Returns: DocumentAnalysisBuilder

Adds a natural-language query for Textract's QUERIES feature, asking a specific question of the document. The alias identifies this query's answer in the analysis response, and the optional page list restricts which pages the query is run against; when omitted it applies to all pages.

ParameterDescription
aliasa short name used to identify this query's answer in the response
queryTextthe natural-language question to ask of the document
pagesthe page numbers to restrict the query to, or none to query all pages

build()

Returns: DocumentAnalysisBuilder

Finalises the builder. This is a no-op provided for a fluent call chain and simply returns this same instance, ready to be passed to a document analysis call.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.