你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
FormRecognizerClient class
- 扩展
构造函数
Form |
初始化 FormRecognizerClient 类的新实例。 |
继承属性
credentials | |
endpoint |
方法
继承的方法
send |
发送使用提供的 OperationSpec 填充的 HTTP 请求。 |
send |
发送提供的 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
属性值
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<AnalyzeWithCustomModelResponse>
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
回调
analyzeWithCustomModel(string, HttpRequestBody, ServiceCallback<AnalyzeResult>)
function analyzeWithCustomModel(id: string, formStream: HttpRequestBody, callback: ServiceCallback<AnalyzeResult>)
参数
- id
-
string
用于分析文档的模型标识符。
- formStream
- HttpRequestBody
要分析的 pdf 文档或图像(jpg,png)文件。
- callback
回调
batchReadReceipt(string, RequestOptionsBase)
批量读取回执操作。 响应包含一个名为“Operation-Location”的字段,其中包含必须用于“获取已读回执结果”操作的 URL。
function batchReadReceipt(url: string, options?: RequestOptionsBase): Promise<BatchReadReceiptResponse>
参数
- url
-
string
图像的可公开访问 URL。
- options
- RequestOptionsBase
可选参数
返回
Promise<BatchReadReceiptResponse>
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)
读取回执操作。 使用“Batch Read Receipt”接口时,响应包含一个名为“Operation-Location”的字段。 “Operation-Location”字段包含必须用于“获取已读回执结果”操作的 URL。
function batchReadReceiptInStream(image: HttpRequestBody, options?: RequestOptionsBase): Promise<BatchReadReceiptInStreamResponse>
参数
- image
- HttpRequestBody
图像流。
- options
- RequestOptionsBase
可选参数
返回
Promise<BatchReadReceiptInStreamResponse>
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<GetCustomModelResponse>
Promise<Models.GetCustomModelResponse>
getCustomModel(string, RequestOptionsBase, ServiceCallback<ModelResult>)
function getCustomModel(id: string, options: RequestOptionsBase, callback: ServiceCallback<ModelResult>)
参数
- id
-
string
模型标识符。
- options
- RequestOptionsBase
可选参数
- callback
回调
getCustomModel(string, ServiceCallback<ModelResult>)
function getCustomModel(id: string, callback: ServiceCallback<ModelResult>)
参数
- id
-
string
模型标识符。
- callback
回调
getCustomModels(RequestOptionsBase)
获取有关所有已训练的自定义模型的信息
function getCustomModels(options?: RequestOptionsBase): Promise<GetCustomModelsResponse>
参数
- options
- RequestOptionsBase
可选参数
返回
Promise<GetCustomModelsResponse>
Promise<Models.GetCustomModelsResponse>
getCustomModels(RequestOptionsBase, ServiceCallback<ModelsResult>)
function getCustomModels(options: RequestOptionsBase, callback: ServiceCallback<ModelsResult>)
参数
- options
- RequestOptionsBase
可选参数
- callback
回调
getCustomModels(ServiceCallback<ModelsResult>)
function getCustomModels(callback: ServiceCallback<ModelsResult>)
参数
- callback
回调
getExtractedKeys(string, RequestOptionsBase)
检索在指定模型训练期间提取的键。
function getExtractedKeys(id: string, options?: RequestOptionsBase): Promise<GetExtractedKeysResponse>
参数
- id
-
string
模型标识符。
- options
- RequestOptionsBase
可选参数
返回
Promise<GetExtractedKeysResponse>
Promise<Models.GetExtractedKeysResponse>
getExtractedKeys(string, RequestOptionsBase, ServiceCallback<KeysResult>)
function getExtractedKeys(id: string, options: RequestOptionsBase, callback: ServiceCallback<KeysResult>)
参数
- id
-
string
模型标识符。
- options
- RequestOptionsBase
可选参数
- callback
回调
getExtractedKeys(string, ServiceCallback<KeysResult>)
function getExtractedKeys(id: string, callback: ServiceCallback<KeysResult>)
参数
- id
-
string
模型标识符。
- callback
回调
getReadReceiptResult(string, RequestOptionsBase)
此接口用于获取“批量读取回执”操作的分析结果。 应从“批读取回执”操作返回的“Operation-Location”字段中检索此接口的 URL。
function getReadReceiptResult(operationId: string, options?: RequestOptionsBase): Promise<GetReadReceiptResultResponse>
参数
- operationId
-
string
在“批量读取回执”操作的响应中返回的读取操作的 ID。
- options
- RequestOptionsBase
可选参数
返回
Promise<GetReadReceiptResultResponse>
Promise<Models.GetReadReceiptResultResponse>
getReadReceiptResult(string, RequestOptionsBase, ServiceCallback<ReadReceiptResult>)
function getReadReceiptResult(operationId: string, options: RequestOptionsBase, callback: ServiceCallback<ReadReceiptResult>)
参数
- operationId
-
string
在“批量读取回执”操作的响应中返回的读取操作的 ID。
- options
- RequestOptionsBase
可选参数
- callback
回调
getReadReceiptResult(string, ServiceCallback<ReadReceiptResult>)
function getReadReceiptResult(operationId: string, callback: ServiceCallback<ReadReceiptResult>)
参数
- operationId
-
string
在“批量读取回执”操作的响应中返回的读取操作的 ID。
- callback
回调
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<TrainCustomModelResponse>
Promise<Models.TrainCustomModelResponse>
trainCustomModel(TrainRequest, RequestOptionsBase, ServiceCallback<TrainResult>)
function trainCustomModel(trainRequest: TrainRequest, options: RequestOptionsBase, callback: ServiceCallback<TrainResult>)
参数
- trainRequest
- TrainRequest
请求用于训练的对象。
- options
- RequestOptionsBase
可选参数
- callback
回调
trainCustomModel(TrainRequest, ServiceCallback<TrainResult>)
function trainCustomModel(trainRequest: TrainRequest, callback: ServiceCallback<TrainResult>)
参数
- trainRequest
- TrainRequest
请求用于训练的对象。
- callback
回调
继承的方法详细信息
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>
继承自
sendRequest(RequestPrepareOptions | WebResourceLike)
发送提供的 httpRequest。
function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>
参数
- options
返回
Promise<HttpOperationResponse>