FormRecognizerClient class

Extends

Constructors

FormRecognizerClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the FormRecognizerClient class.

Inherited Properties

credentials
endpoint

Methods

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams)

Extract key-value pairs from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg' or 'image/png'. A success response is returned in JSON.

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

Batch Read Receipt operation. The response contains a field called 'Operation-Location', which contains the URL that you must use for your 'Get Read Receipt Result' operation.

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

Read Receipt operation. When you use the 'Batch Read Receipt' interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'Get Read Receipt Result' operation.

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

Delete model artifacts.

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

Get information about a model.

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

Get information about all trained custom models

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

Retrieve the keys that were extracted during the training of the specified model.

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

This interface is used for getting the analysis results of a 'Batch Read Receipt' operation. The URL to this interface should be retrieved from the 'Operation-Location' field returned from the 'Batch Read Receipt' operation.

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

Create and train a custom model. The train request must include a source parameter that is either an externally accessible Azure Storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be directly under the source folder. Subfolders are not supported. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg' and 'image/png'." Other type of content is ignored.

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

Inherited Methods

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

Constructor Details

FormRecognizerClient(ServiceClientCredentials, string, ServiceClientOptions)

Initializes a new instance of the FormRecognizerClient class.

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

Parameters

credentials
ServiceClientCredentials

Subscription credentials which uniquely identify client subscription.

endpoint

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).

options
ServiceClientOptions

The parameter options

Inherited Property Details

credentials

credentials: ServiceClientCredentials

Property Value

Inherited From FormRecognizerClientContext.credentials

endpoint

endpoint: string

Property Value

string

Inherited From FormRecognizerClientContext.endpoint

Method Details

analyzeWithCustomModel(string, HttpRequestBody, FormRecognizerClientAnalyzeWithCustomModelOptionalParams)

Extract key-value pairs from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg' or 'image/png'. A success response is returned in JSON.

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

Parameters

id

string

Model Identifier to analyze the document with.

formStream
HttpRequestBody

A pdf document or image (jpg,png) file to analyze.

Returns

Promise<Models.AnalyzeWithCustomModelResponse>

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

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

Parameters

id

string

Model Identifier to analyze the document with.

formStream
HttpRequestBody

A pdf document or image (jpg,png) file to analyze.

callback

ServiceCallback<AnalyzeResult>

The callback

analyzeWithCustomModel(string, HttpRequestBody, ServiceCallback<AnalyzeResult>)

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

Parameters

id

string

Model Identifier to analyze the document with.

formStream
HttpRequestBody

A pdf document or image (jpg,png) file to analyze.

callback

ServiceCallback<AnalyzeResult>

The callback

batchReadReceipt(string, RequestOptionsBase)

Batch Read Receipt operation. The response contains a field called 'Operation-Location', which contains the URL that you must use for your 'Get Read Receipt Result' operation.

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

Parameters

url

string

Publicly reachable URL of an image.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.BatchReadReceiptResponse>

batchReadReceipt(string, RequestOptionsBase, ServiceCallback<void>)

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

Parameters

url

string

Publicly reachable URL of an image.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<void>

The callback

batchReadReceipt(string, ServiceCallback<void>)

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

Parameters

url

string

Publicly reachable URL of an image.

callback

ServiceCallback<void>

The callback

batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase)

Read Receipt operation. When you use the 'Batch Read Receipt' interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'Get Read Receipt Result' operation.

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

Parameters

image
HttpRequestBody

An image stream.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.BatchReadReceiptInStreamResponse>

batchReadReceiptInStream(HttpRequestBody, RequestOptionsBase, ServiceCallback<void>)

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

Parameters

image
HttpRequestBody

An image stream.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<void>

The callback

batchReadReceiptInStream(HttpRequestBody, ServiceCallback<void>)

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

Parameters

image
HttpRequestBody

An image stream.

callback

ServiceCallback<void>

The callback

deleteCustomModel(string, RequestOptionsBase)

Delete model artifacts.

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

Parameters

id

string

The identifier of the model to delete.

options
RequestOptionsBase

The optional parameters

Returns

Promise<RestResponse>

Promise<msRest.RestResponse>

deleteCustomModel(string, RequestOptionsBase, ServiceCallback<void>)

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

Parameters

id

string

The identifier of the model to delete.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<void>

The callback

deleteCustomModel(string, ServiceCallback<void>)

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

Parameters

id

string

The identifier of the model to delete.

callback

ServiceCallback<void>

The callback

getCustomModel(string, RequestOptionsBase)

Get information about a model.

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

Parameters

id

string

Model identifier.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.GetCustomModelResponse>

getCustomModel(string, RequestOptionsBase, ServiceCallback<ModelResult>)

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

Parameters

id

string

Model identifier.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<ModelResult>

The callback

getCustomModel(string, ServiceCallback<ModelResult>)

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

Parameters

id

string

Model identifier.

callback

ServiceCallback<ModelResult>

The callback

getCustomModels(RequestOptionsBase)

Get information about all trained custom models

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

Parameters

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.GetCustomModelsResponse>

getCustomModels(RequestOptionsBase, ServiceCallback<ModelsResult>)

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

Parameters

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<ModelsResult>

The callback

getCustomModels(ServiceCallback<ModelsResult>)

function getCustomModels(callback: ServiceCallback<ModelsResult>)

Parameters

callback

ServiceCallback<ModelsResult>

The callback

getExtractedKeys(string, RequestOptionsBase)

Retrieve the keys that were extracted during the training of the specified model.

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

Parameters

id

string

Model identifier.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.GetExtractedKeysResponse>

getExtractedKeys(string, RequestOptionsBase, ServiceCallback<KeysResult>)

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

Parameters

id

string

Model identifier.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<KeysResult>

The callback

getExtractedKeys(string, ServiceCallback<KeysResult>)

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

Parameters

id

string

Model identifier.

callback

ServiceCallback<KeysResult>

The callback

getReadReceiptResult(string, RequestOptionsBase)

This interface is used for getting the analysis results of a 'Batch Read Receipt' operation. The URL to this interface should be retrieved from the 'Operation-Location' field returned from the 'Batch Read Receipt' operation.

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

Parameters

operationId

string

Id of read operation returned in the response of a 'Batch Read Receipt' operation.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.GetReadReceiptResultResponse>

getReadReceiptResult(string, RequestOptionsBase, ServiceCallback<ReadReceiptResult>)

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

Parameters

operationId

string

Id of read operation returned in the response of a 'Batch Read Receipt' operation.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<ReadReceiptResult>

The callback

getReadReceiptResult(string, ServiceCallback<ReadReceiptResult>)

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

Parameters

operationId

string

Id of read operation returned in the response of a 'Batch Read Receipt' operation.

callback

ServiceCallback<ReadReceiptResult>

The callback

trainCustomModel(TrainRequest, RequestOptionsBase)

Create and train a custom model. The train request must include a source parameter that is either an externally accessible Azure Storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be directly under the source folder. Subfolders are not supported. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg' and 'image/png'." Other type of content is ignored.

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

Parameters

trainRequest
TrainRequest

Request object for training.

options
RequestOptionsBase

The optional parameters

Returns

Promise<Models.TrainCustomModelResponse>

trainCustomModel(TrainRequest, RequestOptionsBase, ServiceCallback<TrainResult>)

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

Parameters

trainRequest
TrainRequest

Request object for training.

options
RequestOptionsBase

The optional parameters

callback

ServiceCallback<TrainResult>

The callback

trainCustomModel(TrainRequest, ServiceCallback<TrainResult>)

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

Parameters

trainRequest
TrainRequest

Request object for training.

callback

ServiceCallback<TrainResult>

The callback

Inherited Method Details

sendOperationRequest(OperationArguments, OperationSpec, ServiceCallback<any>)

Send an HTTP request that is populated using the provided OperationSpec.

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

Parameters

operationArguments
OperationArguments

The arguments that the HTTP request's templated values will be populated from.

operationSpec
OperationSpec

The OperationSpec to use to populate the httpRequest.

callback

ServiceCallback<any>

The callback to call when the response is received.

Returns

Promise<RestResponse>

Inherited From FormRecognizerClientContext.sendOperationRequest

sendRequest(RequestPrepareOptions | WebResourceLike)

Send the provided httpRequest.

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

Parameters

Returns

Inherited From FormRecognizerClientContext.sendRequest