Use this activity to create and train a new custom model that will be used in extracting data from more forms.

Using the source form documents stored in your specified blob storage container, the Train Model activity calls the Form Recognizer Train Custom Model API to create and train a new custom model.

Prerequisites

For training a model, you will need a set of training data in Azure Storage Blob Container.

Refer the following link to create an Azure container to store your training data.

https://azure.microsoft.com/en-us/features/storage-explorer/

Proceed to download and create an azure storage container where you will store the training data.

Get shared access signature

Once the training data is uploaded in the created container, get the Shared Access Signature (SAS) URI by right clicking on the container name. The SAS URI will be the input for training model.

Note: The input data must be in the same format while training a model and analyzing custom forms. For example, if the input for Train Model activity if the input data is in a PDF with certain headings, when you provide your own input in the Analyze Custom Form activity, the input must also be a PDF with similar headings. However, the data can change, but main headings or titles must be similar for successful analysis.

Activity configuration

(1) Drag and drop a TrainModel activity from the AzureAIFormRecognizer package into the AzureAIScope drop zone. Specify True if you want to include subfolders that is inside the blob folder where you have stored the input data for the Train Model activity.

(2) If not specify False in the Include Sub Folders field property.

(3) Specify the Prefix based on the location of the input data. (Similar to selecting a location where you have placed a folder and a subfolder inside that in your local store path.) Refer the following image.

a

Figure 1

(4) Provide the SAS URL in the Source URL field property. Fill appropriate details in all fields in the property window, Refer Technical Reference

(5). In the Output section, Model Location field supports string variable type and returns the model location’s URL, while Result field supports Boolean variable type.

(6) Status Code Field property returns the status of the training that is being done. Create variables accordingly.

e

Figure 2

(1) Drag and drop a WriteLog activity from the notification package. Specify the Input String and log Level for Model Location output.

(2) Execute the workflow.

s

Figure 3

The output will return the Model’s Location URL. The Model Location URL ascertained as the output of the Train Model activity will serve as the input for the Get Model Info Activity.

e

Figure 4

You can also set a WriteLog for Status Code and the Model Location in the output section.

(1) Drag and drop a WriteLog activity from the notification package. Specify the Input String and log Level for Model Location output.

(2) Drag and Drop yet another WriteLog activity. Specify the Input String and Log Level for the Status Code output.

(3) Execute the workflow.

r

Figure 5

The output will state the status of the model’s run, that is, if it has stopped at any stage or completed fully and the Model’s Location. The Model Location URL ascertained as the output of the Train Model activity will serve as the input for the Get Model Info Activity.

x

Figure 6

Technical Reference

s

Figure 7