How can i name the Model at Custom Builder in Form Recognizer?

윤 도호(Do-Ho Yoon) 96 Reputation points
2020-09-15T05:02:23.307+00:00

Greeting!

I found some contents when the custom model be trained, User can name the Model.

So, I've been searched the method in API Documentation.

I think It looks like 'Train Custom Model of Custom Form' in API Link.

But, i can't find to set the name attribute with rest api ..

I test with Rest API Example at bottom of API Link. how can i resolve this??

If there is the another way, please show me the way :)

24783-image.png
Contents Link - https://azure.microsoft.com/en-us/updates/form-recognizer-v2-1/
API Link - https://westcentralus.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-1-preview-1/operations/TrainCustomModelAsync

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 43,701 Reputation points Microsoft Employee
    2020-09-15T15:11:56.877+00:00

    @윤 도호(Do-Ho Yoon) Could you please try to add the following in your request body for the Train REST API?

    The model name definition should be of the following type and cannot be null.

        "ModelName": {  
          "description": "Optional user defined model name (max length: 1024).",  
          "type": "string",  
          "x-nullable": false  
        },  
    

    Body:

    {  
      "source": "string",  
      "sourceFilter": {  
        "prefix": "string",  
        "includeSubFolders": false  
      },  
      "useLabelFile": false,  
       "ModelName": "string"  
    }  
    

1 additional answer

Sort by: Most helpful
  1. 윤 도호(Do-Ho Yoon) 96 Reputation points
    2020-09-16T01:21:50.167+00:00

    I tried to follow your comment,

    At Test, i did to add request body in the Train REST API (v2.1 preview)


    <Request body>

    {
    "source": "< Storage URi >",
    "sourceFilter": {
    "prefix": "<blob Folder>",
    "includeSubFolders": false
    },
    "useLabelFile": false,
    "ModelName": "Model_Test01" <= [Add Attribute]
    }


    Then, Retrun to the response 201 status And Model Id.

    So, i tried to get the model info using Model Id from "Custom Form Model Management - Get Custom Model"

    the result console is below:


    < Get Custom Model Result >

    -envoy-upstream-service-time: 106
    apim-request-id: < ID >
    Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
    x-content-type-options: nosniff
    Date: Wed, 16 Sep 2020 00:50:25 GMT
    Content-Type: application/json; charset=utf-8

    {
    "modelInfo": {
    "modelId": " < Model ID > ",
    "status": "ready",
    "createdDateTime": "2020-09-16T00:45:00Z",
    "lastUpdatedDateTime": "2020-09-16T00:45:24Z"
    },
    "trainResult": {
    "trainingDocuments": [{
    "documentName": " < train01 file >",
    "pages": 1,
    "errors": [],
    "status": "succeeded"
    }, {
    "documentName": " < train02 file >",
    "pages": 1,
    "errors": [],
    "status": "succeeded"
    }, {
    "documentName": " < train03 file >",
    "pages": 1,
    "errors": [],
    "status": "succeeded"
    }, {
    "documentName": " < train04 file >",
    "pages": 1,
    "errors": [],
    "status": "succeeded"
    }, {
    "documentName": " < train05 file >",
    "pages": 1,
    "errors": [],
    "status": "succeeded"
    }],
    "errors": []
    }
    }


    In the Result log, there's not the Model Name..

    is there the Model name Even if it doesn't show me the result?