FormRecognizerClient class
- Extends
Form |
Initializes a new instance of the FormRecognizerClient class. |
analyze |
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. |
analyze |
|
analyze |
|
batch |
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. |
batch |
|
batch |
|
batch |
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. |
batch |
|
batch |
|
delete |
Delete model artifacts. |
delete |
|
delete |
|
get |
Get information about a model. |
get |
|
get |
|
get |
Get information about all trained custom models |
get |
|
get |
|
get |
Retrieve the keys that were extracted during the training of the specified model. |
get |
|
get |
|
get |
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. |
get |
|
get |
|
train |
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. |
train |
|
train |
send |
Send an HTTP request that is populated using the provided OperationSpec. |
send |
Send the provided httpRequest. |
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
credentials: ServiceClientCredentials
Property Value
Inherited From FormRecognizerClientContext.credentials
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.
The optional parameters
Returns
Promise<AnalyzeWithCustomModelResponse>
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.
The optional parameters
- callback
The callback
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
The callback
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<BatchReadReceiptResponse>
Promise<Models.BatchReadReceiptResponse>
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
function batchReadReceipt(url: string, callback: ServiceCallback<void>)
Parameters
- url
-
string
Publicly reachable URL of an image.
- callback
-
ServiceCallback<void>
The callback
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<BatchReadReceiptInStreamResponse>
Promise<Models.BatchReadReceiptInStreamResponse>
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
function batchReadReceiptInStream(image: HttpRequestBody, callback: ServiceCallback<void>)
Parameters
- image
- HttpRequestBody
An image stream.
- callback
-
ServiceCallback<void>
The callback
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>
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
function deleteCustomModel(id: string, callback: ServiceCallback<void>)
Parameters
- id
-
string
The identifier of the model to delete.
- callback
-
ServiceCallback<void>
The callback
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<GetCustomModelResponse>
Promise<Models.GetCustomModelResponse>
function getCustomModel(id: string, options: RequestOptionsBase, callback: ServiceCallback<ModelResult>)
Parameters
- id
-
string
Model identifier.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
function getCustomModel(id: string, callback: ServiceCallback<ModelResult>)
Parameters
- id
-
string
Model identifier.
- callback
The callback
Get information about all trained custom models
function getCustomModels(options?: RequestOptionsBase): Promise<GetCustomModelsResponse>
Parameters
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<GetCustomModelsResponse>
Promise<Models.GetCustomModelsResponse>
function getCustomModels(options: RequestOptionsBase, callback: ServiceCallback<ModelsResult>)
Parameters
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
function getCustomModels(callback: ServiceCallback<ModelsResult>)
Parameters
- callback
The callback
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<GetExtractedKeysResponse>
Promise<Models.GetExtractedKeysResponse>
function getExtractedKeys(id: string, options: RequestOptionsBase, callback: ServiceCallback<KeysResult>)
Parameters
- id
-
string
Model identifier.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
function getExtractedKeys(id: string, callback: ServiceCallback<KeysResult>)
Parameters
- id
-
string
Model identifier.
- callback
The callback
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<GetReadReceiptResultResponse>
Promise<Models.GetReadReceiptResultResponse>
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
The callback
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
The callback
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<TrainCustomModelResponse>
Promise<Models.TrainCustomModelResponse>
function trainCustomModel(trainRequest: TrainRequest, options: RequestOptionsBase, callback: ServiceCallback<TrainResult>)
Parameters
- trainRequest
- TrainRequest
Request object for training.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
function trainCustomModel(trainRequest: TrainRequest, callback: ServiceCallback<TrainResult>)
Parameters
- trainRequest
- TrainRequest
Request object for training.
- callback
The callback
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
Send the provided httpRequest.
function sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise<HttpOperationResponse>
Parameters
- options
Returns
Promise<HttpOperationResponse>
Inherited From FormRecognizerClientContext.sendRequest
Azure SDK for JavaScript feedback
Azure SDK for JavaScript is an open source project. Select a link to provide feedback: