Azure AI Document Intelligence - can't call Custom Classification model via API

Richard Jackson 86 Reputation points
2024-05-09T10:29:28.13+00:00

Hi there,

I've trained a model with Model ID of "my-custom-classification-model" as a Custom Classification model within Azure AI Document Intelligence. However, I'm unable to call this model via API endpoint, receiving a "The requested model was not found" response.

Here's a proof-of-concept GET request based on the REST API documentation. Note that this is successful for a Custom Extraction model but not for a Custom Classification model:

Request:

GET {endpoint}/formrecognizer/documentModels/my-custom-classification-model?api-version=2023-07-31 Authorization: Bearer undefined Ocp-apim-subscription-key: {subscription-key}

Response:

{
  "error": {
    "code": "NotFound",
    "message": "Resource not found.",
    "innererror": {
      "code": "ModelNotFound",
      "message": "The requested model was not found."
    }
  }
}

Any guidance would be greatly appreciated.

Thanks!

Rich

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

Accepted answer
  1. santoshkc 4,925 Reputation points Microsoft Vendor
    2024-05-09T12:01:15.4533333+00:00

    Hi @Richard Jackson,

    Thank you for reaching out to Microsoft Q&A forum!

    I'm able to repro your issue using the POSTMAN tool. Please attempt to replicate the steps provided below using REST API:

    Use the POST request followed by GET request in the Postman. Once the POST request was done in the Postman, we get the "Operation Location". Kindly use this "Operation Location" URL in the GET request in postman. Please also provide the API key, content type etc in the GET request as well and click on "SEND" button in postman.

    Note: The headers, body in the postman are important to configure while sending the POST request followed by the GET request.

    Here is the API documentation: Document Classifiers - Classify Document.

    POST: {endpoint}/formrecognizer/documentClassifiers/{classifierId}:analyze?api-version=2023-07-31

    Screenshots from Postman:

    POST:User's image

    Inside the "Body" of POST request, you can select the "binary" option to use the local files (or) else you can provide BLOB container SAS URL by selection "raw" option:

    User's image Take a note of the "Operation Location" from above step, after clicking on the "SEND" button.

    GET:

    User's image

    I hope you understand. And, if you have any further query do let us know.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful