Azure document intelligence (OCR) is not stable? How to fix or set a random seed?

Huỳnh Hoàng Huy 0 Reputation points
2025-07-29T06:49:44.7266667+00:00

Hi everyone,

I am using this service (AI Document Intelligence) for OCR task. I used prebuilt invoice model. I find the automatic table detection feature of this service quite good. Many times it helps the results become clearer. However, yesterday I encountered a case where the service with 2 runs gave 2 different results. And the different location was in the table area that the service automatically detected.

I mean, in my specific case, on the paper there was actually no table available, only keyword fields separated by spaces. And this service automatically determined that there was a table there. However, after 2 runs, the table in this position had a different number of columns. It makes my final result has problem.

So, is there a parameter related to random seed that exists? Or is there any way to keep the result after multiple runs?

with open(pdf_path, "rb") as f:
        poller = client.begin_analyze_document(
            model_id="prebuilt-invoice",
            analyze_request=f,
            content_type="image/png"
        )

Note: I am using free tier, and it has remaining free transaction amount.

Azure AI Document Intelligence
{count} votes

1 answer

Sort by: Most helpful
  1. Aryan Parashar 150 Reputation points Microsoft External Staff Moderator
    2025-08-06T08:44:12.1433333+00:00

    Hi Huỳnh,
    There is no seed parameter related to a random seed that exists. Here is the supported documentation:
    http://learn.microsoft.com/en-us/python/api/azure-ai-formrecognizer/azure.ai.formrecognizer.documentanalysisclient?view=azure-python

    It cannot produce identical results across multiple runs, as there is no seed parameter. To save results, you can store the output locally or in cloud storage.

    Thanks for reaching out to the Microsoft Q&A Portal.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.