你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

@azure/ai-form-recognizer package

AzureKeyCredential

支持更新基础密钥值的基于静态密钥的凭据。

DocumentAnalysisClient

用于与表单识别器服务分析功能的交互的客户端。

例子:

表单识别器服务和客户端支持两种身份验证方式:

Azure Active Directory

JavaScript
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 密钥(订阅密钥)

JavaScript
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

用于与表单识别器服务模型管理功能交互的客户端,例如创建、读取、列出、删除和复制模型。

例子:

Azure Active Directory

TypeScript
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 密钥(订阅密钥)

TypeScript
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);

接口

AddressValue

地址字段值。

AnalyzeDocumentOptions

文档分析作的选项。

AnalyzeResult

分析作的结果。 文档的类型可由用于执行分析的模型确定。

AnalyzeResultCommon

所有 AnalyzeResult 类类型的常见字段,例如 LayoutResult、ReadResult 和 GeneralDocumentResult。

AnalyzedDocument

提取的文档对象。

AnalyzedDocument 是模型中文档类型之一的实例。 其字段对应于文档类型的字段架构。

AzureBlobFileListSource

由 Azure Blob 容器和容器中的 JSONL 文件列表定义的训练数据源。

AzureBlobFileListSourceDetails

Azure Blob 存储中的文件列表。

AzureBlobSource

由 Azure Blob 容器定义的训练数据源。

AzureBlobSourceDetails

Azure Blob 存储内容。

BeginBuildDocumentClassifierOptions

文档分类器生成作的选项。

BeginBuildDocumentModelOptions

模型生成作的选项。

BeginComposeDocumentModelOptions

模型撰写作的选项。

BeginCopyModelOptions

复制模型作的选项。

BoundingRegion

输入的特定页上的边界多边形。

ClassifierDocumentTypeDetails

分类器文档类型信息。

ClassifyDocumentOptions

文档分类作的选项。

CommonModelCreationOptions

定义新模型的所有作通用的选项,例如 beginBuildDocumentModelbeginComposeDocumentModelgetCopyAuthorization

CopyAuthorization

授权将文档模型复制到指定的目标资源和 modelId。

CreateDocumentModelOptions

模型创建作的选项。

CurrencyValue

货币字段值。

CustomDocumentModelsDetails

有关自定义文档模型的详细信息。

DeleteDocumentModelOptions

用于删除模型的选项。

DocumentAddressField

描述结构化物理地址的文档字段。

DocumentAnalysisClientOptions

DocumentAnalysisClient 的可配置选项。

DocumentAnalysisPollOperationState

分析作的状态,最终将生成与模型对应的结果类型。

DocumentAnnotation

文档中的视觉注释元素,如复选标记或交叉。

DocumentArrayField

包含嵌套字段数组的 DocumentField。 数组中的所有字段都具有相同的类型。

DocumentBarcode

提取的条形码。

DocumentBooleanField

具有布尔值的 DocumentField。

DocumentCaption

一个对象,表示表格标题的位置和内容。

DocumentClassifierBuildOperationDetails

获取作响应对象。

DocumentClassifierDetails

文档分类器信息。

DocumentClassifierDocumentTypeSources

用于创建文档分类器的一组源。 这是文档类型名称的映射,用于训练模型以对相应源类型的文档进行分类。

DocumentClassifierOperationState

模型创建作的状态。

DocumentCountryRegionField

一个 DocumentField,该值指示国家或地区,表示为字符串。

DocumentCurrencyField

描述特定货币金额的 DocumentField。

DocumentDateField

具有 Date 值的 DocumentField。

DocumentFieldCommon

所有 DocumentField 变体通用的字段。

DocumentFieldSchema

使用 JSON 架构样式语法描述字段语义架构。

DocumentFootnote

一个对象,表示表脚注的位置和内容。

DocumentFormula

提取的公式。

DocumentIntegerField

具有整数值的 DocumentField。

DocumentKeyValueElement

一个对象,表示键值对中的字段键或值。

DocumentKeyValuePair

一个对象,表示具有不同字段标签(键)和字段值(可能为空)的窗体字段。

DocumentLanguage

一个对象,表示给定文本范围的检测到的语言。

DocumentLine

内容行对象,由相邻的内容元素序列(如字词和选择标记)组成。

DocumentModel

支持提取结构化文档的已知模型规范。

请参阅 DocumentAnalysisClientbeginAnalyzeDocument 方法,该方法支持使用这些 DocumentModel 对象而不是模型 ID 字符串来提供更强的结果类型。

DocumentModelAdministrationClientOptions

DocumentModelAdministrationClient 的可配置选项。

DocumentModelBuildOperationDetails

获取作响应对象。

DocumentModelComposeOperationDetails

获取作响应对象。

DocumentModelCopyToOperationDetails

获取作响应对象。

DocumentModelDetails

文档模型信息。

DocumentModelOperationState

模型创建作的状态。

DocumentModelSummary

文档模型摘要。

DocumentNumberField

具有数字值的 DocumentField。

DocumentObjectField

一个 DocumentField,由具有其自己的 DocumentField 值的多个命名属性组成。

DocumentPage

从输入页中提取的内容和布局元素。

DocumentParagraph

包含连续线条的段落对象通常具有常见的对齐和间距。

DocumentPhoneNumberField

具有电话号码值的 DocumentField,表示为字符串。

DocumentSelectionMark

表示复选框、单选按钮和其他指示所选内容的元素的选择标记对象。

DocumentSelectionMarkField

一个 DocumentField,该值指示选择标记状态(如复选框或单选按钮),表示为字符串。

DocumentSignatureField

一个 DocumentField,指示签名的状态,表示为字符串。

DocumentSpan

串联内容属性的连续区域,指定为偏移量和长度。

DocumentStringField

具有字符串值的 DocumentField。

DocumentStyle

表示观察到的文本样式的对象。

DocumentTable

一个表格对象,该对象由排列在矩形布局中的表格单元格组成。

DocumentTableCell

一个对象,表示表单元格的位置和内容。

DocumentTimeField

具有时间值的 DocumentField,表示为字符串。

DocumentTypeDetails

文档类型信息。

DocumentValueField

具有基元值的简单字段,如字符串、数字等。

DocumentWord

由连续字符序列组成的单词对象。 对于非空格分隔语言(如中文、日语和朝鲜语),每个字符都表示为自己的单词。

ErrorModel

错误信息。

GetCopyAuthorizationOptions

获取复制授权方法的选项。

GetModelOptions

用于检索模型信息的选项。

GetOperationOptions

用于检索作状态的选项。

GetResourceDetailsOptions

用于检索表单识别器资源信息的选项。

HasBoundingPolygon

简单的文档元素(如单词、选择标记和线条)由多边形绑定。

InnerError

详细错误。

ListModelsOptions

用于列出模型的选项。

ListOperationsOptions

列出作的选项。

ModelAdministrationOperationStateCommon

所有管理作通用的字段集。

OperationDetails

获取作响应对象。

OperationSummary

作信息。

Point2D

表示用于定义边界多边形的点。 单位为“像素”或“英寸”(请参阅 LengthUnit)。

PollerOptions

表单识别器客户端中长时间运行的作(轮询器)的选项。

QuotaDetails

使用的配额、限制和下一次重置日期/时间。

ResourceDetails

有关当前资源的常规信息。

类型别名

AnalysisPoller

一个长时间运行的作(轮询器),用于跟踪分析作的状态,最终生成与模型对应的结果类型。

AnalyzeResultOperationStatus

定义 AnalyzeResultOperationStatus 的值。

DocumentBarcodeKind

定义 DocumentBarcodeKind 的值。
KnownDocumentBarcodeKind 可与 DocumentBarcodeKind 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

QRCode:QR 码,如 ISO/IEC 18004:2015 中定义。
PDF417:ISO 15438 中定义的 PDF417。
UPCA:GS1 12 位通用产品代码。
UPCE:GS1 6 位通用产品名称。
Code39:代码 39 条形码,如 ISO/IEC 16388:2007 中定义。
Code128:在 ISO/IEC 15417:2007 中定义的代码 128 条形码。
EAN8:GS1 8 位国际项目编号(欧洲项目编号)。
EAN13:GS1 13 位国际项目编号(欧洲项目编号)。
DataBar:GS1 DataBar 条形码。
Code93:在 ANSI/AIM BC5-1995 中定义的代码 93 条形码。
Codabar:Codabar 条形码,如 ANSI/AIM BC3-1995 中定义。
DataBarExpanded:GS1 DataBar 扩展条形码。
ITF:交错 2(共 5 种条形码),如 ANSI/AIM BC2-1995 中定义。
MicroQRCode:在 ISO/IEC 23941:2022 中定义的 Micro QR 码。
Aztec:在 ISO/IEC 24778:2008 中定义的 Aztec 代码。
DataMatrix:ISO/IEC 16022:2006 中定义的数据矩阵代码。
MaxiCode:MaxiCode,在 ISO/IEC 16023:2000 中定义。

DocumentBuildMode

定义 DocumentBuildMode 的值。
KnownDocumentBuildMode 可与 DocumentBuildMode 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

模板:使用类似视觉模板的目标文档。
神经:支持具有各种视觉模板的文档。

DocumentClassifierPoller

一个长时间运行的作(轮询器),用于跟踪自定义分类器创建作的状态,最终生成 DocumentClassifierDetails

DocumentClassifierSource

可用于生成文档分类器的内容源。

其中一项:

  • BlobSource
  • BlobFileListSource
DocumentField

提取的字段。 kind 属性标识 DocumentField的类型(区分)。

DocumentFieldType

定义 DocumentFieldType 的值。
KnownDocumentFieldType 可与 DocumentFieldType 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

字符串:纯文本。
日期:日期,规范化为 ISO 8601 (YYYY-MM-DD) 格式。
时间:时间,规范化为 ISO 8601 (hh:mm:ss) 格式。
phoneNumber:电话号码,规范化为 E.164 (+{CountryCode}{SubscriberNumber}) 格式。
数字:浮点数,规范化为双精度浮点。
整数:整数数,规范化为 64 位有符号整数。
selectionMark:是否选择了字段?
countryRegion:国家/地区,规范化为 ISO 3166-1 alpha-3 格式(例如美国)。
签名:签名是否存在?
数组:相同类型的子字段列表。
对象:可能不同类型的子字段的命名列表。
货币:具有可选货币符号和单位的货币金额。
地址:已分析的地址。
布尔:布尔值,规范化为 true 或 false。

DocumentFormulaKind

定义 DocumentFormulaKind 的值。
KnownDocumentFormulaKind 可与 DocumentFormulaKind 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

内联:嵌入段落内容的公式。
显示:显示模式下占用整行的公式。

DocumentModelBuildMode

支持的模型生成模式。 模型生成模式选择服务用于基于标记训练数据训练模型的引擎。

选项包括:

  • “神经”,它产生最高质量的模型,能够从具有相同数据结构的文档类中提取数据,但不同的布局(例如,W2 税务表单,这可能因公司而异,但始终包含相同的信息)。
  • “template”,这要求所有文档具有相同的固定布局(模板)。

有关详细信息,请参阅以下链接:https://aka.ms/azsdk/formrecognizer/buildmode

DocumentModelPoller

一个长时间运行的作(轮询器),用于跟踪模型创建作的状态,最终生成 DocumentModelDetails

DocumentModelSource

可用于生成文档模型的内容源。

其中一项:

  • BlobSource
  • BlobFileListSource
DocumentSignatureType

定义 DocumentSignatureType 的值。
KnownDocumentSignatureType 可与 DocumentSignatureType 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

签名:检测到签名。
未签名:未检测到签名。

DocumentTableCellKind

定义 DocumentTableCellKind 的值。
KnownDocumentTableCellKind 可与 DocumentTableCellKind 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

内容:包含主要内容/数据。
rowHeader:描述行的内容。
columnHeader:描述列的内容。
存根头:描述行标题,通常位于表格左上角。
说明:描述表(部分)中的内容。

FontStyle

定义 FontStyle 的值。
KnownFontStyle 可与 FontStyle 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

正常:字符通常表示。
斜体:字符在视觉上向右倾斜。

FontWeight

定义 FontWeight 的值。
KnownFontWeight 可与 FontWeight 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

正常:字符通常表示。
粗体:字符用较粗的笔划表示。

FormRecognizerFeature

可为请求启用的附加功能(功能)。

有关表单识别器中可用的功能的详细信息,请参阅服务文档:

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

FormRecognizerRequestBody

可将二进制数据上传到表单识别器服务的请求输入。 表单识别器将 string 输入视为 URL,因此,若要将字符串作为 二进制 输入发送,请先将字符串转换为以下输入类型之一。

LengthUnit

定义 LengthUnit 的值。
KnownLengthUnit 可与 LengthUnit 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

像素:图像文件的长度单位。
英寸:PDF 文件的长度单位。

OperationDetailsUnion

有关多种不同类型的表单识别器管理作中的任何一种的详细信息。

OperationKind

定义 OperationKind 的值。
KnownOperationKind 可与 OperationKind 互换,此枚举包含服务支持的已知值。

服务支持的已知值

documentModelBuild:生成新的自定义文档模型。
documentModelCompose:从现有模型撰写新的自定义文档模型。
documentModelCopyTo:将现有文档模型复制到可能不同的资源、区域或订阅。
documentClassifierBuild:生成新的自定义分类器模型。

OperationStatus

定义 OperationStatus 的值。

ParagraphRole

定义 ParagraphRole 的值。
KnownParagraphRole 可与 ParagraphRole 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

pageHeader:页面上边缘附近的文本。
pageFooter:页面下边缘附近的文本。
pageNumber:页码。
标题:描述整个文档的顶级标题。
sectionHeading:描述文档部分的子标题。
脚注:通常放在页面上主内容之后的便笺。
formulaBlock:公式块,通常采用共享对齐方式。

SelectionMarkState

定义 SelectionMarkState 的值。
KnownSelectionMarkState 可与 SelectionMarkState 互换使用,此枚举包含服务支持的已知值。

服务支持的已知值

选定:选择标记被选中,通常由选中标记内的复选标记或交叉 X 指示。
未选择:未选择选择标记。

StringIndexType

表单识别器服务和 SDK 客户端支持的有效字符串索引类型。

枚举

KnownDocumentBarcodeKind

DocumentBarcodeKind 服务接受的已知值。

KnownDocumentBuildMode

DocumentBuildMode 服务的已知值。

KnownDocumentFieldType

service 接受的 DocumentFieldType 的已知值

KnownDocumentFormulaKind

DocumentFormulaKind 服务的已知值。

KnownDocumentSignatureType

DocumentSignatureType 的已知值 服务接受的值。

KnownDocumentTableCellKind

服务接受的 DocumentTableCellKind 的已知值。

KnownFontStyle

FontStyle 服务的已知值。

KnownFontWeight

FontWeight 服务的已知值。

KnownLengthUnit

服务的 LengthUnit 已知值。

KnownOperationKind

服务的 OperationKind 已知值。

KnownParagraphRole

服务接受的 ParagraphRole 的已知值。

KnownSelectionMarkState

服务的 SelectionMarkState 已知值。