Share via

Is there a way to assess the input document's quality or get an overall confidence score from the prebuilt-layout API to decide whether to proceed or halt?

ALAGARSAMY Vanitha 40 Reputation points
2025-10-07T06:06:45.44+00:00

Hi,
I am using Azure Document Intelligence with an S0 subscription and the prebuilt-layout API (API version: 2024-11-30, General Availability v4.0) to extract text from JPG and scanned PDF documents. I would like to assess the quality of the input document alongside the extracted text.

Is it possible to obtain an overall quality score for the input document, or at least a confidence score for the extracted text? Based on a defined threshold, can we determine whether it's appropriate to proceed to the next step or halt the process

Azure Document Intelligence in Foundry Tools
0 comments No comments

2 answers

Sort by: Most helpful
  1. SRILAKSHMI C 17,865 Reputation points Microsoft External Staff Moderator
    2025-10-07T08:00:49.4266667+00:00

    Hello ALAGARSAMY Vanitha,

    Welcome to Microsoft Q&A and thank you for reaching out.

    I understand that you're looking to evaluate the quality of documents processed through the Azure Document Intelligence prebuilt-layout API, specifically to determine whether you can obtain a confidence score for text extraction and use it to decide whether to proceed or halt further processing.

    Currently, the prebuilt-layout API does not provide a single overall quality score for the entire document. Its primary purpose is to extract text, layout, and structural information, and while it doesn’t offer a document-level quality metric, it does return confidence scores for individual extracted elements such as words, lines, paragraphs, and tables.

    Here’s how you can leverage this information in your workflow:

    Each text element returned by the API includes a confidence property, representing the system’s confidence in the accuracy of that specific extraction. These scores can help you assess the reliability of the output and make informed decisions about how to proceed.

    You can aggregate or average the per-element confidence scores across a document to approximate an overall quality metric for your scenario. For example, if the average confidence score is below a certain threshold (e.g., 0.75), you may choose to halt automated processing or flag the document for manual review.

    If input quality is a recurring concern, consider adding preprocessing steps such as checking image resolution, skew, or blur before sending documents to the prebuilt-layout API. This can help you filter out poor-quality scans early in the pipeline.

    For scenarios where document quality assessment is critical, you could also explore training a lightweight classification model using Azure AI or Computer Vision to categorize documents (e.g., Good vs. Poor quality) before processing them with Document Intelligence.

    I Hope this helps. Do let me know if you have any further queries.


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

    Thank you!

    1 person found this answer helpful.
    0 comments No comments

  2. Alex Burlachenko 20,585 Reputation points MVP Volunteer Moderator
    2025-10-07T09:32:05.3366667+00:00

    Hi Vanitha,

    That's a really smart question about document quality assessment )) it's so important to have that confidence measure before moving forward with automated processing.

    For the prebuilt-layout API in Azure Document Intelligence, you don't get a single overall document quality score, but you can absolutely access confidence metrics at the individual word and line level that serve the same purpose.

    In the API response, look for the "confidence" field within each "word" object in the JSON output. This gives you a probability score between 0 and 1 for how confident the model is about each specific text extraction. You can calculate an average confidence across all words to create your own overall document quality score.

    After calling the prebuilt-layout API, parse through the response and extract all the word-level confidence scores. Calculate the average across the entire document, or if you have specific key fields that are critical, focus on those areas specifically.

    Set your threshold based on your use case requirements. For most business documents, an average confidence of 0.8 or higher is usually reliable, but you might want to set it higher for critical data or lower for less important content.

    You can also look at the number of words with very low confidence scores. If you see a cluster of low-confidence extractions in a particular area, it might indicate a problem with that section of the document specifically.

    The Document Intelligence REST API documentation shows the response format and where to find these confidence values https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/concept-layout.

    If you're getting very little extracted text from a document that should have plenty of content, that itself can be a quality indicator that something went wrong with the OCR process.

    For scanned documents, you might want to add a pre-processing step to check image quality factors like resolution, contrast, and skew before even sending to the API. This can save you processing time and costs.

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/


Your answer

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