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

FormRecognizerClient class

Extends

构造函数

FormRecognizerClient(ServiceClientCredentials, string, ServiceClientOptions)

初始化 FormRecognizerClient 类的新实例。

继承属性

credentials
endpoint

方法

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams)

从给定的文档中提取键值对。 输入文档必须是支持的内容类型之一:“application/pdf”、“image/jpeg”或“image/png”。 系统将返回 JSON 格式的成功响应,

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams, ServiceCallback<AnalyzeResult>)
analyzeWithCustomModel(string, HttpRequestBody, ServiceCallback<AnalyzeResult>)
batchReadReceipt(string, RequestOptionsBase)

批量读取回执操作。 响应包含名为“Operation-Location”的字段,该字段包含“获取已读回执结果”操作必须使用的 URL。

batchReadReceipt(string, RequestOptionsBase, ServiceCallback<void>)
batchReadReceipt(string, ServiceCallback<void>)
batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase)

读取回执操作。 使用“批量读取回执”接口时,响应包含一个名为“Operation-Location”的字段。 “操作位置”字段包含必须用于“获取读取回执结果”操作的 URL。

batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase, ServiceCallback<void>)
batchReadReceiptInStream(HttpRequestBody, ServiceCallback<void>)
deleteCustomModel(string, RequestOptionsBase)

删除模型项目。

deleteCustomModel(string, RequestOptionsBase, ServiceCallback<void>)
deleteCustomModel(string, ServiceCallback<void>)
getCustomModel(string, RequestOptionsBase)

获取有关模型的信息。

getCustomModel(string, RequestOptionsBase, ServiceCallback<ModelResult>)
getCustomModel(string, ServiceCallback<ModelResult>)
getCustomModels(RequestOptionsBase)

获取有关所有已训练的自定义模型的信息

getCustomModels(RequestOptionsBase, ServiceCallback<ModelsResult>)
getCustomModels(ServiceCallback<ModelsResult>)
getExtractedKeys(string, RequestOptionsBase)

检索在指定模型训练期间提取的键。

getExtractedKeys(string, RequestOptionsBase, ServiceCallback<KeysResult>)
getExtractedKeys(string, ServiceCallback<KeysResult>)
getReadReceiptResult(string, RequestOptionsBase)

此接口用于获取“批量读取回执”操作的分析结果。 应从“批量读取回执”操作返回的“Operation-Location”字段检索此接口的 URL。

getReadReceiptResult(string, RequestOptionsBase, ServiceCallback<ReadReceiptResult>)
getReadReceiptResult(string, ServiceCallback<ReadReceiptResult>)
trainCustomModel(TrainRequest, RequestOptionsBase)

创建和训练自定义模型。 训练请求必须包含源参数,该参数是外部可访问的 Azure 存储 Blob 容器 URI(最好是共享访问签名 URI),或者是本地装载的驱动器中某个数据文件夹的有效路径。 指定本地路径时,它们必须遵循 Linux/Unix 路径格式,并且是根植于输入装载配置设置值的绝对路径,例如,如果“{Mounts:Input}”配置设置值为“/input”,则有效的源路径为“/input/contosodataset”。 要训练的所有数据都应直接位于源文件夹下。 不支持子文件夹。 使用内容类型为“application/pdf”、“image/jpeg”和“image/png”的文档训练模型。”忽略其他类型的内容。

trainCustomModel(TrainRequest, RequestOptionsBase, ServiceCallback<TrainResult>)
trainCustomModel(TrainRequest, ServiceCallback<TrainResult>)

继承的方法

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

发送使用提供的 OperationSpec 填充的 HTTP 请求。

sendRequest(RequestPrepareOptions | WebResourceLike)

发送提供的 httpRequest。

构造函数详细信息

FormRecognizerClient(ServiceClientCredentials, string, ServiceClientOptions)

初始化 FormRecognizerClient 类的新实例。

new FormRecognizerClient(credentials: ServiceClientCredentials, endpoint: string, options?: ServiceClientOptions)

参数

credentials
ServiceClientCredentials

唯一标识客户端订阅的订阅凭据。

endpoint

string

支持的认知服务终结点 (协议和主机名,例如: https://westus2.api.cognitive.microsoft.com) 。

options
ServiceClientOptions

参数选项

继承属性详细信息

credentials

credentials: ServiceClientCredentials

属性值

继承自FormRecognizerClientContext.credentials

endpoint

endpoint: string

属性值

string

继承自FormRecognizerClientContext.endpoint

方法详细信息

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams)

从给定的文档中提取键值对。 输入文档必须是支持的内容类型之一:“application/pdf”、“image/jpeg”或“image/png”。 系统将返回 JSON 格式的成功响应,

function analyzeWithCustomModel(id: string, formStream: HttpRequestBody, options?: FormRecognizerClientAnalyzeWithCustomModelOptionalParams): Promise<AnalyzeWithCustomModelResponse>

参数

id

string

用于分析文档的模型标识符。

formStream
HttpRequestBody

要分析的 pdf 文档或图像 (jpg,png) 文件。

返回

Promise<Models.AnalyzeWithCustomModelResponse>

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams, ServiceCallback<AnalyzeResult>)

function analyzeWithCustomModel(id: string, formStream: HttpRequestBody, options: FormRecognizerClientAnalyzeWithCustomModelOptionalParams, callback: ServiceCallback<AnalyzeResult>)

参数

id

string

用于分析文档的模型标识符。

formStream
HttpRequestBody

要分析的 pdf 文档或图像 (jpg,png) 文件。

callback

ServiceCallback<AnalyzeResult>

回调

analyzeWithCustomModel(string, HttpRequestBody, ServiceCallback<AnalyzeResult>)

function analyzeWithCustomModel(id: string, formStream: HttpRequestBody, callback: ServiceCallback<AnalyzeResult>)

参数

id

string

用于分析文档的模型标识符。

formStream
HttpRequestBody

要分析的 pdf 文档或图像 (jpg,png) 文件。

callback

ServiceCallback<AnalyzeResult>

回调

batchReadReceipt(string, RequestOptionsBase)

批量读取回执操作。 响应包含名为“Operation-Location”的字段,该字段包含“获取已读回执结果”操作必须使用的 URL。

function batchReadReceipt(url: string, options?: RequestOptionsBase): Promise<BatchReadReceiptResponse>

参数

url

string

图像的可公开访问 URL。

options
RequestOptionsBase

可选参数

返回

Promise<Models.BatchReadReceiptResponse>

batchReadReceipt(string, RequestOptionsBase, ServiceCallback<void>)

function batchReadReceipt(url: string, options: RequestOptionsBase, callback: ServiceCallback<void>)

参数

url

string

图像的可公开访问 URL。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<void>

回调

batchReadReceipt(string, ServiceCallback<void>)

function batchReadReceipt(url: string, callback: ServiceCallback<void>)

参数

url

string

图像的可公开访问 URL。

callback

ServiceCallback<void>

回调

batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase)

读取回执操作。 使用“批量读取回执”接口时,响应包含一个名为“Operation-Location”的字段。 “操作位置”字段包含必须用于“获取读取回执结果”操作的 URL。

function batchReadReceiptInStream(image: HttpRequestBody, options?: RequestOptionsBase): Promise<BatchReadReceiptInStreamResponse>

参数

image
HttpRequestBody

图像流。

options
RequestOptionsBase

可选参数

返回

Promise<Models.BatchReadReceiptInStreamResponse>

batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase, ServiceCallback<void>)

function batchReadReceiptInStream(image: HttpRequestBody, options: RequestOptionsBase, callback: ServiceCallback<void>)

参数

image
HttpRequestBody

图像流。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<void>

回调

batchReadReceiptInStream(HttpRequestBody, ServiceCallback<void>)

function batchReadReceiptInStream(image: HttpRequestBody, callback: ServiceCallback<void>)

参数

image
HttpRequestBody

图像流。

callback

ServiceCallback<void>

回调

deleteCustomModel(string, RequestOptionsBase)

删除模型项目。

function deleteCustomModel(id: string, options?: RequestOptionsBase): Promise<RestResponse>

参数

id

string

要删除的模型的标识符。

options
RequestOptionsBase

可选参数

返回

Promise<RestResponse>

Promise<msRest.RestResponse>

deleteCustomModel(string, RequestOptionsBase, ServiceCallback<void>)

function deleteCustomModel(id: string, options: RequestOptionsBase, callback: ServiceCallback<void>)

参数

id

string

要删除的模型的标识符。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<void>

回调

deleteCustomModel(string, ServiceCallback<void>)

function deleteCustomModel(id: string, callback: ServiceCallback<void>)

参数

id

string

要删除的模型的标识符。

callback

ServiceCallback<void>

回调

getCustomModel(string, RequestOptionsBase)

获取有关模型的信息。

function getCustomModel(id: string, options?: RequestOptionsBase): Promise<GetCustomModelResponse>

参数

id

string

模型标识符。

options
RequestOptionsBase

可选参数

返回

Promise<Models.GetCustomModelResponse>

getCustomModel(string, RequestOptionsBase, ServiceCallback<ModelResult>)

function getCustomModel(id: string, options: RequestOptionsBase, callback: ServiceCallback<ModelResult>)

参数

id

string

模型标识符。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<ModelResult>

回调

getCustomModel(string, ServiceCallback<ModelResult>)

function getCustomModel(id: string, callback: ServiceCallback<ModelResult>)

参数

id

string

模型标识符。

callback

ServiceCallback<ModelResult>

回调

getCustomModels(RequestOptionsBase)

获取有关所有已训练的自定义模型的信息

function getCustomModels(options?: RequestOptionsBase): Promise<GetCustomModelsResponse>

参数

options
RequestOptionsBase

可选参数

返回

Promise<Models.GetCustomModelsResponse>

getCustomModels(RequestOptionsBase, ServiceCallback<ModelsResult>)

function getCustomModels(options: RequestOptionsBase, callback: ServiceCallback<ModelsResult>)

参数

options
RequestOptionsBase

可选参数

callback

ServiceCallback<ModelsResult>

回调

getCustomModels(ServiceCallback<ModelsResult>)

function getCustomModels(callback: ServiceCallback<ModelsResult>)

参数

callback

ServiceCallback<ModelsResult>

回调

getExtractedKeys(string, RequestOptionsBase)

检索在指定模型训练期间提取的键。

function getExtractedKeys(id: string, options?: RequestOptionsBase): Promise<GetExtractedKeysResponse>

参数

id

string

模型标识符。

options
RequestOptionsBase

可选参数

返回

Promise<Models.GetExtractedKeysResponse>

getExtractedKeys(string, RequestOptionsBase, ServiceCallback<KeysResult>)

function getExtractedKeys(id: string, options: RequestOptionsBase, callback: ServiceCallback<KeysResult>)

参数

id

string

模型标识符。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<KeysResult>

回调

getExtractedKeys(string, ServiceCallback<KeysResult>)

function getExtractedKeys(id: string, callback: ServiceCallback<KeysResult>)

参数

id

string

模型标识符。

callback

ServiceCallback<KeysResult>

回调

getReadReceiptResult(string, RequestOptionsBase)

此接口用于获取“批量读取回执”操作的分析结果。 应从“批量读取回执”操作返回的“Operation-Location”字段检索此接口的 URL。

function getReadReceiptResult(operationId: string, options?: RequestOptionsBase): Promise<GetReadReceiptResultResponse>

参数

operationId

string

在“批量读取回执”操作的响应中返回的读取操作的 ID。

options
RequestOptionsBase

可选参数

返回

Promise<Models.GetReadReceiptResultResponse>

getReadReceiptResult(string, RequestOptionsBase, ServiceCallback<ReadReceiptResult>)

function getReadReceiptResult(operationId: string, options: RequestOptionsBase, callback: ServiceCallback<ReadReceiptResult>)

参数

operationId

string

在“批量读取回执”操作的响应中返回的读取操作的 ID。

options
RequestOptionsBase

可选参数

getReadReceiptResult(string, ServiceCallback<ReadReceiptResult>)

function getReadReceiptResult(operationId: string, callback: ServiceCallback<ReadReceiptResult>)

参数

operationId

string

在“批量读取回执”操作的响应中返回的读取操作的 ID。

trainCustomModel(TrainRequest, RequestOptionsBase)

创建和训练自定义模型。 训练请求必须包含源参数,该参数是外部可访问的 Azure 存储 Blob 容器 URI(最好是共享访问签名 URI),或者是本地装载的驱动器中某个数据文件夹的有效路径。 指定本地路径时,它们必须遵循 Linux/Unix 路径格式,并且是根植于输入装载配置设置值的绝对路径,例如,如果“{Mounts:Input}”配置设置值为“/input”,则有效的源路径为“/input/contosodataset”。 要训练的所有数据都应直接位于源文件夹下。 不支持子文件夹。 使用内容类型为“application/pdf”、“image/jpeg”和“image/png”的文档训练模型。”忽略其他类型的内容。

function trainCustomModel(trainRequest: TrainRequest, options?: RequestOptionsBase): Promise<TrainCustomModelResponse>

参数

trainRequest
TrainRequest

用于训练的请求对象。

options
RequestOptionsBase

可选参数

返回

Promise<Models.TrainCustomModelResponse>

trainCustomModel(TrainRequest, RequestOptionsBase, ServiceCallback<TrainResult>)

function trainCustomModel(trainRequest: TrainRequest, options: RequestOptionsBase, callback: ServiceCallback<TrainResult>)

参数

trainRequest
TrainRequest

用于训练的请求对象。

options
RequestOptionsBase

可选参数

callback

ServiceCallback<TrainResult>

回调

trainCustomModel(TrainRequest, ServiceCallback<TrainResult>)

function trainCustomModel(trainRequest: TrainRequest, callback: ServiceCallback<TrainResult>)

参数

trainRequest
TrainRequest

用于训练的请求对象。

callback

ServiceCallback<TrainResult>

回调

继承的方法详细信息

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

发送使用提供的 OperationSpec 填充的 HTTP 请求。

function sendOperationRequest(operationArguments: OperationArguments, operationSpec: OperationSpec, callback?: ServiceCallback<any>): Promise<RestResponse>

参数

operationArguments
OperationArguments

将从中填充 HTTP 请求的模板化值的参数。

operationSpec
OperationSpec

用于填充 httpRequest 的 OperationSpec。

callback

ServiceCallback<any>

接收响应时要调用的回调。

返回

Promise<RestResponse>

继承自FormRecognizerClientContext.sendOperationRequest

sendRequest(RequestPrepareOptions | WebResourceLike)

发送提供的 httpRequest。

function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>

参数

返回

继承自FormRecognizerClientContext.sendRequest