@azure/ai-form-recognizer package

Classes

AzureKeyCredential

A static-key-based credential that supports updating the underlying key value.

DocumentAnalysisClient

A client for interacting with the Form Recognizer service's analysis features.

Examples:

The Form Recognizer service and clients support two means of authentication:

Azure Active Directory

import { DocumentAnalysisClient } from "@azure/ai-form-recognizer";
import { DefaultAzureCredential } from "@azure/identity";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new DefaultAzureCredential();

const client = new DocumentAnalysisClient(endpoint, credential);

API Key (Subscription Key)

import { DocumentAnalysisClient, AzureKeyCredential } from "@azure/ai-form-recognizer";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new AzureKeyCredential("<api key>");

const client = new DocumentAnalysisClient(endpoint, credential);
DocumentModelAdministrationClient

A client for interacting with the Form Recognizer service's model management features, such as creating, reading, listing, deleting, and copying models.

Examples:

Azure Active Directory

import { DocumentModelAdministrationClient } from "@azure/ai-form-recognizer";
import { DefaultAzureCredential } from "@azure/identity";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new DefaultAzureCredential();

const client = new DocumentModelAdministrationClient(endpoint, credential);

API Key (Subscription Key)

import { DocumentModelAdministrationClient, AzureKeyCredential } from "@azure/ai-form-recognizer";

const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new AzureKeyCredential("<api key>");

const client = new DocumentModelAdministrationClient(endpoint, credential);

Interfaces

AddressValue

Address field value.

AnalyzeDocumentOptions

Options for the document analysis operation.

AnalyzeResult

The result of an analysis operation. The type of the Document may be determined by the model used to perform the analysis.

AnalyzeResultCommon

The common fields of all AnalyzeResult-like types, such as LayoutResult, ReadResult, and GeneralDocumentResult.

AnalyzedDocument

An extracted document object.

An AnalyzedDocument is an instance of one of the document types within a model. Its fields correspond to the field schema of the document type.

AzureBlobFileListSource

A training data source defined by an Azure Blob Container and a JSONL file list within the container.

AzureBlobFileListSourceDetails

File list in Azure Blob Storage.

AzureBlobSource

A training data source defined by an Azure Blob Container.

AzureBlobSourceDetails

Azure Blob Storage content.

BeginBuildDocumentClassifierOptions

Options for the document classifier build operation.

BeginBuildDocumentModelOptions

Options for the model build operation.

BeginComposeDocumentModelOptions

Options for the model compose operation.

BeginCopyModelOptions

Options for the copy model operation.

BoundingRegion

Bounding polygon on a specific page of the input.

ClassifierDocumentTypeDetails

Classifier document type info.

ClassifyDocumentOptions

Options for the document classification operation.

CommonModelCreationOptions

Options common to all operations that define new models, such as beginBuildDocumentModel, beginComposeDocumentModel, and getCopyAuthorization.

CopyAuthorization

Authorization to copy a document model to the specified target resource and modelId.

CreateDocumentModelOptions

Options for the model creation operation.

CurrencyValue

Currency field value.

CustomDocumentModelsDetails

Details regarding custom document models.

DeleteDocumentModelOptions

Options for model deletion.

DocumentAddressField

A document field that describes a structured physical address.

DocumentAnalysisClientOptions

Configurable options for DocumentAnalysisClient.

DocumentAnalysisPollOperationState

The state of an analysis operation, which will eventually produce the result type that corresponds to the model.

DocumentAnnotation

A visual annotation element in the document, such as a check mark or cross.

DocumentArrayField

A DocumentField that consists of an array of nested fields. All fields in the array will have the same type.

DocumentBarcode

An extracted barcode.

DocumentBooleanField

A DocumentField that has a boolean value.

DocumentCaption

An object representing the location and content of a table caption.

DocumentClassifierBuildOperationDetails

Get Operation response object.

DocumentClassifierDetails

Document classifier info.

DocumentClassifierDocumentTypeSources

A set of sources used to create a document classifier. This is a map of document type names to sources that will be used to train the model to classify documents of the corresponding source type.

DocumentClassifierOperationState

The state of a model creation operation.

DocumentCountryRegionField

A DocumentField that has a value indicating a country or region, represented as a string.

DocumentCurrencyField

A DocumentField that describes an amount of a certain currency.

DocumentDateField

A DocumentField that has a Date value.

DocumentFieldCommon

Fields that are common to all DocumentField variants.

DocumentFieldSchema

Description of the field semantic schema using a JSON Schema style syntax.

DocumentFootnote

An object representing the location and content of a table footnote.

DocumentFormula

An extracted formula.

DocumentIntegerField

A DocumentField that has an integer value.

DocumentKeyValueElement

An object representing the field key or value in a key-value pair.

DocumentKeyValuePair

An object representing a form field with distinct field label (key) and field value (may be empty).

DocumentLanguage

An object representing the detected language for a given text span.

DocumentLine

A content line object consisting of an adjacent sequence of content elements, such as words and selection marks.

DocumentModel

A well-known model specification that supports extracting structured documents.

See the beginAnalyzeDocument method of DocumentAnalysisClient, which supports consuming these DocumentModel objects instead of model ID strings to provide stronger result types.

DocumentModelAdministrationClientOptions

Configurable options for DocumentModelAdministrationClient.

DocumentModelBuildOperationDetails

Get Operation response object.

DocumentModelComposeOperationDetails

Get Operation response object.

DocumentModelCopyToOperationDetails

Get Operation response object.

DocumentModelDetails

Document model info.

DocumentModelOperationState

The state of a model creation operation.

DocumentModelSummary

Document model summary.

DocumentNumberField

A DocumentField that has a number value.

DocumentObjectField

A DocumentField that consists of several named properties that have their own DocumentField values.

DocumentPage

Content and layout elements extracted from a page from the input.

DocumentParagraph

A paragraph object consisting with contiguous lines generally with common alignment and spacing.

DocumentPhoneNumberField

A DocumentField that has a phone number value, represented as a string.

DocumentSelectionMark

A selection mark object representing check boxes, radio buttons, and other elements indicating a selection.

DocumentSelectionMarkField

A DocumentField that is has a value indicating a selection mark state (such as a checkbox or radio button), represented as a string.

DocumentSignatureField

A DocumentField that indicates the state of a signature, represented as a string.

DocumentSpan

Contiguous region of the concatenated content property, specified as an offset and length.

DocumentStringField

A DocumentField that has a string value.

DocumentStyle

An object representing observed text styles.

DocumentTable

A table object consisting table cells arranged in a rectangular layout.

DocumentTableCell

An object representing the location and content of a table cell.

DocumentTimeField

A DocumentField that has a time value, represented as a string.

DocumentTypeDetails

Document type info.

DocumentValueField

A simple field that has a primitive value, such as a string, number etc.

DocumentWord

A word object consisting of a contiguous sequence of characters. For non-space delimited languages, such as Chinese, Japanese, and Korean, each character is represented as its own word.

ErrorModel

Error info.

GetCopyAuthorizationOptions

Options for the get copy authorization method.

GetModelOptions

Options for retrieving model information.

GetOperationOptions

Options for retrieving an operation state.

GetResourceDetailsOptions

Options for retrieving Form Recognizer resource information.

HasBoundingPolygon

Simple document elements such as words, selection marks and lines are bounded by the polygon.

InnerError

Detailed error.

ListModelsOptions

Options for listing models.

ListOperationsOptions

Options for listing operations.

ModelAdministrationOperationStateCommon

The set of fields common to all administration operations.

OperationDetails

Get Operation response object.

OperationSummary

Operation info.

Point2D

Represents a point used to define bounding polygons. The unit is either 'pixel' or 'inch' (See LengthUnit).

PollerOptions

Options for long-running operations (pollers) in the Form Recognizer clients.

QuotaDetails

Quota used, limit, and next reset date/time.

ResourceDetails

General information regarding the current resource.

Type Aliases

AnalysisPoller

A long-running operation (poller) that tracks the state of an analysis operation, eventually producing the result type that corresponds to the model.

AnalyzeResultOperationStatus

Defines values for AnalyzeResultOperationStatus.

DocumentBarcodeKind

Defines values for DocumentBarcodeKind.
KnownDocumentBarcodeKind can be used interchangeably with DocumentBarcodeKind, this enum contains the known values that the service supports.

Known values supported by the service

QRCode: QR code, as defined in ISO/IEC 18004:2015.
PDF417: PDF417, as defined in ISO 15438.
UPCA: GS1 12-digit Universal Product Code.
UPCE: GS1 6-digit Universal Product Code.
Code39: Code 39 barcode, as defined in ISO/IEC 16388:2007.
Code128: Code 128 barcode, as defined in ISO/IEC 15417:2007.
EAN8: GS1 8-digit International Article Number (European Article Number).
EAN13: GS1 13-digit International Article Number (European Article Number).
DataBar: GS1 DataBar barcode.
Code93: Code 93 barcode, as defined in ANSI/AIM BC5-1995.
Codabar: Codabar barcode, as defined in ANSI/AIM BC3-1995.
DataBarExpanded: GS1 DataBar Expanded barcode.
ITF: Interleaved 2 of 5 barcode, as defined in ANSI/AIM BC2-1995.
MicroQRCode: Micro QR code, as defined in ISO/IEC 23941:2022.
Aztec: Aztec code, as defined in ISO/IEC 24778:2008.
DataMatrix: Data matrix code, as defined in ISO/IEC 16022:2006.
MaxiCode: MaxiCode, as defined in ISO/IEC 16023:2000.

DocumentBuildMode

Defines values for DocumentBuildMode.
KnownDocumentBuildMode can be used interchangeably with DocumentBuildMode, this enum contains the known values that the service supports.

Known values supported by the service

template: Target documents with similar visual templates.
neural: Support documents with diverse visual templates.

DocumentClassifierPoller

A long-running operation (poller) that tracks the state of a custom classifier creation operation, eventually producing a DocumentClassifierDetails.

DocumentClassifierSource

A content source that may be used to build a document classifier.

One of:

  • BlobSource
  • BlobFileListSource
DocumentField

An extracted field. The kind property identifies (discriminates) the type of the DocumentField.

DocumentFieldType

Defines values for DocumentFieldType.
KnownDocumentFieldType can be used interchangeably with DocumentFieldType, this enum contains the known values that the service supports.

Known values supported by the service

string: Plain text.
date: Date, normalized to ISO 8601 (YYYY-MM-DD) format.
time: Time, normalized to ISO 8601 (hh:mm:ss) format.
phoneNumber: Phone number, normalized to E.164 (+{CountryCode}{SubscriberNumber}) format.
number: Floating point number, normalized to double precision floating point.
integer: Integer number, normalized to 64-bit signed integer.
selectionMark: Is field selected?
countryRegion: Country/region, normalized to ISO 3166-1 alpha-3 format (ex. USA).
signature: Is signature present?
array: List of subfields of the same type.
object: Named list of subfields of potentially different types.
currency: Currency amount with optional currency symbol and unit.
address: Parsed address.
boolean: Boolean value, normalized to true or false.

DocumentFormulaKind

Defines values for DocumentFormulaKind.
KnownDocumentFormulaKind can be used interchangeably with DocumentFormulaKind, this enum contains the known values that the service supports.

Known values supported by the service

inline: A formula embedded within the content of a paragraph.
display: A formula in display mode that takes up an entire line.

DocumentModelBuildMode

Supported model build modes. The model build mode selects the engine that the service uses to train the model based on the labeled training data.

The options are:

  • "neural", which yields the highest quality of model that is capable of extracting data from classes of documents that have the same structure of data, but different layouts (for example, W2 tax forms, which may vary from company to company, but always contain the same information).
  • "template", which requires all documents to have the same fixed layout (template).

Please see the following link for more information: https://aka.ms/azsdk/formrecognizer/buildmode

DocumentModelPoller

A long-running operation (poller) that tracks the state of a model creation operation, eventually producing a DocumentModelDetails.

DocumentModelSource

A content source that may be used to build a document model.

One of:

  • BlobSource
  • BlobFileListSource
DocumentSignatureType

Defines values for DocumentSignatureType.
KnownDocumentSignatureType can be used interchangeably with DocumentSignatureType, this enum contains the known values that the service supports.

Known values supported by the service

signed: A signature is detected.
unsigned: No signatures are detected.

DocumentTableCellKind

Defines values for DocumentTableCellKind.
KnownDocumentTableCellKind can be used interchangeably with DocumentTableCellKind, this enum contains the known values that the service supports.

Known values supported by the service

content: Contains the main content/data.
rowHeader: Describes the content of the row.
columnHeader: Describes the content of the column.
stubHead: Describes the row headers, usually located at the top left corner of a table.
description: Describes the content in (parts of) the table.

FontStyle

Defines values for FontStyle.
KnownFontStyle can be used interchangeably with FontStyle, this enum contains the known values that the service supports.

Known values supported by the service

normal: Characters are represented normally.
italic: Characters are visually slanted to the right.

FontWeight

Defines values for FontWeight.
KnownFontWeight can be used interchangeably with FontWeight, this enum contains the known values that the service supports.

Known values supported by the service

normal: Characters are represented normally.
bold: Characters are represented with thicker strokes.

FormRecognizerFeature

Add-on capabilities (features) that can be enabled for the request.

For more information about the features available in Form Recognizer, see the service documentation:

https://aka.ms/azsdk/formrecognizer/features

FormRecognizerRequestBody

A request input that can be uploaded as binary data to the Form Recognizer service. Form Recognizer treats string inputs as URLs, so to send a string as a binary input, first convert the string to one of the following input types.

LengthUnit

Defines values for LengthUnit.
KnownLengthUnit can be used interchangeably with LengthUnit, this enum contains the known values that the service supports.

Known values supported by the service

pixel: Length unit for image files.
inch: Length unit for PDF files.

OperationDetailsUnion

Details about any of several different types of Form Recognizer management operations.

OperationKind

Defines values for OperationKind.
KnownOperationKind can be used interchangeably with OperationKind, this enum contains the known values that the service supports.

Known values supported by the service

documentModelBuild: Build a new custom document model.
documentModelCompose: Compose a new custom document model from existing models.
documentModelCopyTo: Copy an existing document model to potentially a different resource, region, or subscription.
documentClassifierBuild: Build a new custom classifier model.

OperationStatus

Defines values for OperationStatus.

ParagraphRole

Defines values for ParagraphRole.
KnownParagraphRole can be used interchangeably with ParagraphRole, this enum contains the known values that the service supports.

Known values supported by the service

pageHeader: Text near the top edge of the page.
pageFooter: Text near the bottom edge of the page.
pageNumber: Page number.
title: Top-level title describing the entire document.
sectionHeading: Sub heading describing a section of the document.
footnote: A note usually placed after the main content on a page.
formulaBlock: A block of formulas, often with shared alignment.

SelectionMarkState

Defines values for SelectionMarkState.
KnownSelectionMarkState can be used interchangeably with SelectionMarkState, this enum contains the known values that the service supports.

Known values supported by the service

selected: The selection mark is selected, often indicated by a check ✓ or cross X inside the selection mark.
unselected: The selection mark is not selected.

StringIndexType

Valid string index types supported by the Form Recognizer service and SDK clients.

Enums

KnownDocumentBarcodeKind

Known values of DocumentBarcodeKind that the service accepts.

KnownDocumentBuildMode

Known values of DocumentBuildMode that the service accepts.

KnownDocumentFieldType

Known values of DocumentFieldType that the service accepts.

KnownDocumentFormulaKind

Known values of DocumentFormulaKind that the service accepts.

KnownDocumentSignatureType

Known values of DocumentSignatureType that the service accepts.

KnownDocumentTableCellKind

Known values of DocumentTableCellKind that the service accepts.

KnownFontStyle

Known values of FontStyle that the service accepts.

KnownFontWeight

Known values of FontWeight that the service accepts.

KnownLengthUnit

Known values of LengthUnit that the service accepts.

KnownOperationKind

Known values of OperationKind that the service accepts.

KnownParagraphRole

Known values of ParagraphRole that the service accepts.

KnownSelectionMarkState

Known values of SelectionMarkState that the service accepts.