@azure/ai-form-recognizer package

類別

AzureKeyCredential

支援更新基礎金鑰值的靜態索引鍵型認證。

DocumentAnalysisClient

用來與表格辨識器服務分析功能的互動用戶端。

範例:

表格辨識器服務和用戶端支援兩種驗證方式:

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 金鑰 (訂用帳戶金鑰)

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

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 金鑰 (訂用帳戶金鑰)

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

取得 Operation 回應物件。

DocumentClassifierDetails

檔分類器資訊。

DocumentClassifierDocumentTypeSources

一組用來建立檔分類器的來源。 這是檔案類型名稱與來源的對應,用來定型模型來分類對應來源類型的檔。

DocumentClassifierOperationState

模型建立作業的狀態。

DocumentCountryRegionField

DocumentField,其值表示國家或地區,以字串表示。

DocumentCurrencyField

描述特定貨幣金額的 DocumentField。

DocumentDateField

具有 Date 值的 DocumentField。

DocumentFieldCommon

所有 DocumentField 變體通用的欄位。

DocumentFieldSchema

使用 JSON 架構樣式語法的欄位語意架構描述。

DocumentFootnote

物件,表示資料表註腳的位置和內容。

DocumentFormula

擷取的公式。

DocumentIntegerField

具有整數值的 DocumentField。

DocumentKeyValueElement

物件,表示索引鍵/值組中的欄位索引鍵或值。

DocumentKeyValuePair

物件,代表具有不同欄位標籤的表單欄位 (索引鍵) 和域值 (可能是空的) 。

DocumentLanguage

物件,表示指定文字範圍的偵測到語言。

DocumentLine

內容行物件,由連續的內容專案序列所組成,例如文字和選取標記。

DocumentModel

支援擷取結構化檔的已知模型規格。

beginAnalyzeDocument請參閱DocumentAnalysisClient的 方法,其支援取用這些 DocumentModel 物件,而不是模型識別碼字串,以提供更強的結果類型。

DocumentModelAdministrationClientOptions

DocumentModelAdministrationClient 的可設定選項。

DocumentModelBuildOperationDetails

取得 Operation 回應物件。

DocumentModelComposeOperationDetails

取得 Operation 回應物件。

DocumentModelCopyToOperationDetails

取得 Operation 回應物件。

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

由連續字元序列組成的 word 物件。 對於非空格分隔的語言,例如中文、日文和韓文,每個字元都會以自己的單字表示。

ErrorModel

錯誤資訊。

GetCopyAuthorizationOptions

取得複製授權方法的選項。

GetModelOptions

擷取模型資訊的選項。

GetOperationOptions

擷取作業狀態的選項。

GetResourceDetailsOptions

擷取表格辨識器資源資訊的選項。

HasBoundingPolygon

簡單的檔元素,例如字組、選取標記和線條,都是由多邊形所系結。

InnerError

詳細的錯誤。

ListModelsOptions

列出模型的選項。

ListOperationsOptions

列出作業的選項。

ModelAdministrationOperationStateCommon

所有系統管理作業通用的欄位集。

OperationDetails

取得 Operation 回應物件。

OperationSummary

作業資訊。

Point2D

表示用來定義周框多邊形的點。 單位為 「圖元」或「英吋」, (請參閱 LengthUnit) 。

PollerOptions

表格辨識器用戶端中) 長時間執行的作業選項 (輪詢器。

QuotaDetails

已使用配額、限制和下一次重設日期/時間。

ResourceDetails

關於目前資源的一般資訊。

類型別名

AnalysisPoller

長時間執行的作業 (輪詢器) 追蹤分析作業的狀態,最終會產生對應至模型的結果類型。

AnalyzeResultOperationStatus

定義 AnalyzeResultOperationStatus 的值。

DocumentBarcodeKind

定義 DocumentBarcodeKind 的值。
KnownDocumentBarcodeKind 可以與 DocumentBarcodeKind 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

QRCode:QR 代碼,如 ISO/IEC 18004:2015 中所定義。
PDF417:PDF417,如 ISO 15438 中所定義。
UPCA:GS1 12 位數通用產品代碼。
UPCE:GS1 6 位數通用產品代碼。
Code39:Code 39 條碼,如 ISO/IEC 16388:2007 中所定義。
Code128:Code 128 條碼,如 ISO/IEC 15417:2007 中所定義。
EAN8:GS1 8 位數國際發行項編號 (歐洲發行項編號) 。
EAN13:GS1 13 位數國際發行項編號 (歐洲發行項編號) 。
DataBar:GS1 DataBar 條碼。
Code93:Code 93 條碼,如 ANSI/AIM BC5-1995 中所定義。
Codabar:Codabar條碼,如 ANSI/AIM BC3-1995 中所定義。
DataBarExpanded:GS1 DataBar 展開條碼。
ITF:交錯 2/5 條碼,如 ANSI/AIM BC2-1995 中所定義。
MicroQRCode:Micro QR 代碼,如 ISO/IEC 23941:2022 中所定義。
Aztec:Aztec程式碼,如 ISO/IEC 24778:2008 中所定義。
DataMatrix:資料矩陣程式碼,如 ISO/IEC 16022:2006 中所定義。
MaxiCode:MaxiCode,如 ISO/IEC 16023:2000 中所定義。

DocumentBuildMode

定義 DocumentBuildMode 的值。
KnownDocumentBuildMode 可與 DocumentBuildMode 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

template:以類似視覺範本的檔為目標。
類神經:支援具有各種視覺範本的檔。

DocumentClassifierPoller

長時間執行的作業 (輪詢器) 追蹤自訂分類器建立作業的狀態,最終會產生 DocumentClassifierDetails

DocumentClassifierSource

可用來建置檔分類器的內容來源。

值為下列其中之一:

  • BlobSource
  • BlobFileListSource
DocumentField

擷取的欄位。 屬性 kind 會識別 (區分) 的類型 DocumentField

DocumentFieldType

定義 DocumentFieldType 的值。
KnownDocumentFieldType 可以與 DocumentFieldType 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

string:純文字。
date:日期,標準化為 ISO 8601 (YYYY-MM-DD) 格式。
time:時間,標準化為 ISO 8601 (hh:mm:ss) 格式。
phoneNumber:電話號碼,標準化為 E.164 (+{CountryCode}{SubscriberNumber}) 格式。
number:浮點數,標準化為雙精確度浮點數。
整數:整數,標準化為 64 位帶正負號的整數。
selectionMark:是否選取欄位?
countryRegion:國家/地區,標準化為 ISO 3166-1 Alpha-3 格式 (,例如美國) 。
簽章:簽章是否存在?
array:相同類型的子欄位清單。
物件:可能不同類型之子欄位的具名清單。
貨幣:具有選擇性貨幣符號和單位的貨幣金額。
address:剖析的位址。
布林值:布林值,標準化為 true 或 false。

DocumentFormulaKind

定義 DocumentFormulaKind 的值。
KnownDocumentFormulaKind 可以與 DocumentFormulaKind 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

內嵌:內嵌在段落內容中的公式。
display:顯示模式中佔用整行的公式。

DocumentModelBuildMode

支援的模型建置模式。 模型建置模式會根據標示的定型資料,選取服務用來定型模型的引擎。

選項包括:

  • 「類神經」會產生最高品質的模型,能夠從具有相同資料結構的檔類別擷取資料,但不同的版面配置 (例如 W2 稅務表單,這可能會因公司而異,但一律包含相同的資訊) 。
  • 「template」,要求所有檔都有相同的固定版面配置 (範本) 。

如需詳細資訊,請參閱下列連結: https://aka.ms/azsdk/formrecognizer/buildmode

DocumentModelPoller

長時間執行的作業 (輪詢器) 追蹤模型建立作業的狀態,最終會產生 DocumentModelDetails

DocumentModelSource

可用來建置檔模型的內容來源。

值為下列其中之一:

  • BlobSource
  • BlobFileListSource
DocumentSignatureType

定義 DocumentSignatureType 的值。
KnownDocumentSignatureType 可以與 DocumentSignatureType 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

已簽署:偵測到簽章。
未簽署:未偵測到任何簽章。

DocumentTableCellKind

定義 DocumentTableCellKind 的值。
KnownDocumentTableCellKind 可以與 DocumentTableCellKind 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

content:包含主要內容/資料。
rowHeader:描述資料列的內容。
columnHeader:描述資料行的內容。
stubHead:描述資料列標頭,通常位於資料表的左上角。
描述:描述資料表) (部分的內容。

FontStyle

定義 FontStyle 的值。
KnownFontStyle 可以與 FontStyle 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

normal:字元會正常表示。
斜體:字元會以視覺方式向右斜體。

FontWeight

定義 FontWeight 的值。
KnownFontWeight 可以與 FontWeight 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

normal:字元會正常表示。
粗體:字元會以較粗的筆劃表示。

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:頁碼。
title:描述整個檔的最上層標題。
sectionHeading:描述檔區段的子標題。
註腳:通常放在頁面上主要內容之後的附注。
formulaBlock:公式區塊,通常具有共用對齊方式。

SelectionMarkState

定義 SelectionMarkState 的值。
KnownSelectionMarkState 可以與 SelectionMarkState 交換使用,此列舉包含服務支援的已知值。

服務支援的已知值

selected:已選取選取標記,通常是以選取標記內的 check ✓ 或 cross X 表示。
未選取:未選取選取的選取標記。

StringIndexType

表格辨識器服務和 SDK 用戶端支援的有效字串索引類型。

列舉

KnownDocumentBarcodeKind

服務接受的 DocumentBarcodeKind 已知值。

KnownDocumentBuildMode

服務接受的 DocumentBuildMode 已知值。

KnownDocumentFieldType

服務接受的 DocumentFieldType 已知值。

KnownDocumentFormulaKind

服務接受的 DocumentFormulaKind 已知值。

KnownDocumentSignatureType

服務接受的 DocumentSignatureType 已知值。

KnownDocumentTableCellKind

服務接受的 DocumentTableCellKind 已知值。

KnownFontStyle

服務接受的 FontStyle 已知值。

KnownFontWeight

服務接受的 FontWeight 已知值。

KnownLengthUnit

服務接受的 LengthUnit 已知值。

KnownOperationKind

服務接受的 OperationKind 已知值。

KnownParagraphRole

服務接受的 ParagraphRole 已知值。

KnownSelectionMarkState

服務接受的 SelectionMarkState 已知值。