[OutSystems.AI Document Processor Reactive] TrainCustomModel action
Question
Forge component by Rui Parente

Hi,

Could you please explain how to use TrainCustomModel server action from the Azure Cognitive Services Connector? What are the parameters and where to find them in Azure?

Thanks,

Michal

Michal Witek wrote:

Hi,

Could you please explain how to use TrainCustomModel server action from the Azure Cognitive Services Connector? What are the parameters and where to find them in Azure?

Thanks,

Michal

 Hi Michal,

Have you looked into the tab Model training process in the component's try now page?

 It shows all the resources that need to be created in your Azure account as well as what parameters are necessary to have the TrainCustomModel server action working.

Let me know if this was of any help.

Best regards,

Rui Parente

Hi Rui,

I did. It does not explain TrainCustomModel action at all.

Michal Witek wrote:

Hi Rui,

I did. It does not explain TrainCustomModel action at all.

  1.  You need to have an Azure account and create an instance of the Form Recognizer service.
  2. From that resource, you'll extract the key that will be used in the site property OcpApimSubscriptionKey_FormRecognizerAPI from the Azure Cognitive Services Connector
  3. Create a Storage Account in Azure in which you will create a new container and upload your documents (forms or receipts)
  4. From this Storage Account you get the Blob Service SAS URL. This URL will be set in the only mandatory field for theTrainCustomModel server action 
  5. If you created a file for the documents inside the container you'll need to set the boolean parameter IncludeSubFolders as True
  6. The TrainCustomModel server action is in the Azure Cognitive Services Connector
  7. From this action, you'll get the ModelId that will be used to retrieve results from the server action GetAnalyzeFormData 

 

Hello Rui.

I'm trying to use the OutSystems.AI Document Processor Reactive.

The Source field did not appear in the TrainCustomModel server action's properties. The Request field did.

I have set the Request field with the value of Blob Service SAS URL, got an error: "Syntax error caused by unexpected ':' in expression".


Then I tried to use the URL without the "https://" part, and also got an error: "Expecting an expression instead of end of line".

Please help.

Hi @Hyberson Pereira

I faced with the same problem what did you find. I "Request" field I have entered the endpoint for Forms Recognizer API but I got the following error:

Invalid Data Type

'FormRecognizer_TrainCustomModelsRequest' data type required instead of 'Text'.

Could you tell me, did you solve your problem? What did you enter in Field "Request" or what I have made wrong.

Tnx

Zeljko 




Prsentation1.jpg

Hello Zeljko. 

I did not solve the problem. 

I'm no longer using OutSystems. 

Good luck. 


Hi Rui,

Thanks for your response.

I am new to Azure therefore can't find Blob Service SAS URL within Storage Account. Where can I find it? I can only see: Resource ID, Primary endpoint and Secondary endpoint.

Michal Witek wrote:

Hi Rui,

Thanks for your response.

I am new to Azure therefore can't find Blob Service SAS URL within Storage Account. Where can I find it? I can only see: Resource ID, Primary endpoint and Secondary endpoint.

 Hi Michal,

To get the Blob Service SAS URL you must have the Storage account resource already created.

When you access the detail screen for the Storage account resource you'll have a menu bar on the left side as the following image: 

You then click on the highlighted menu item and you'll find a button saying Generate SAS and connection string. I recommend you to explore some of Azure documentation if you find that you're stuck while creating the necessary resources.

 

Hi Rui,

Thanks for your help. I appreciate it.

I am now getting the error:

1001: Specified model not found or not ready

What may be the reason of this?

The same here...

{  "error": {    "code": "1001",    "message": "Specified model not found or not ready, Model Id: XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX"  } }

@Michal Witek the error you're getting might be related to an issue with the SAS URL.

My suggestion is for you to try the following steps:

  • In Azure go to your Storage Account resource
  • In the menu for the resource click on Storage Explorer (preview)
  • Expand the Blob Containers menu and right-click on the name of the container in which your files are stored
  • Click on Get Shared Access Signature (SAS)
  • In the box that is opened, you can change the expiry time for the SAS and also the permissions, however, you must keep the Read and List permissions
  • Click on Create
  • Finally copy the URI for the SAS and paste it in the Source input parameter for the TrainCustomModel action.

You can check the gif attached to this message with the necessary steps.

Hope this helps you and sorry for the late response.

Best regards,

Rui Parente


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.