FormRecognizerClient class
- Extends
Constructors
Form |
Initializes a new instance of the FormRecognizerClient class. |
Inherited Properties
credentials | |
endpoint |
Methods
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 |
Inherited Methods
send |
Send an HTTP request that is populated using the provided OperationSpec. |
send |
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
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.
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
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
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<BatchReadReceiptResponse>
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<BatchReadReceiptInStreamResponse>
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<GetCustomModelResponse>
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
The callback
getCustomModel(string, ServiceCallback<ModelResult>)
function getCustomModel(id: string, callback: ServiceCallback<ModelResult>)
Parameters
- id
-
string
Model identifier.
- callback
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<GetCustomModelsResponse>
Promise<Models.GetCustomModelsResponse>
getCustomModels(RequestOptionsBase, ServiceCallback<ModelsResult>)
function getCustomModels(options: RequestOptionsBase, callback: ServiceCallback<ModelsResult>)
Parameters
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
getCustomModels(ServiceCallback<ModelsResult>)
function getCustomModels(callback: ServiceCallback<ModelsResult>)
Parameters
- callback
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<GetExtractedKeysResponse>
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
The callback
getExtractedKeys(string, ServiceCallback<KeysResult>)
function getExtractedKeys(id: string, callback: ServiceCallback<KeysResult>)
Parameters
- id
-
string
Model identifier.
- callback
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<GetReadReceiptResultResponse>
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
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
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<TrainCustomModelResponse>
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
The callback
trainCustomModel(TrainRequest, ServiceCallback<TrainResult>)
function trainCustomModel(trainRequest: TrainRequest, callback: ServiceCallback<TrainResult>)
Parameters
- trainRequest
- TrainRequest
Request object for training.
- callback
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
- options
Returns
Promise<HttpOperationResponse>
Inherited From FormRecognizerClientContext.sendRequest
Azure SDK for JavaScript