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.
| Parameter | Description |
|---|---|
feature | the primary feature to enable, ignored if blank |
features | any 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.
| Parameter | Description |
|---|---|
alias | a short name used to identify this query's answer in the response |
queryText | the natural-language question to ask of the document |
pages | the 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.