Running a composed model with only one extraction algorithm

Marques Chacon 40 Reputation points
2025-01-24T02:39:45.9166667+00:00

I have two document types that I want to create a composed model from. One of the document types is null/irrelevant/"other" data which I don't want extracted. The other document type contains relevant information that I want to run through an extraction algorithm. Is this possible to do?

I can run classification and filter based on the classification confidence to then go into an extraction model, but I was wondering if it was possible to combine this in one composed model. I understand that composed models require at least two extraction models, but is it possible to use the same extraction model on both classifications, and set the confidence threshold for the null class to 1?

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

1 answer

Sort by: Most helpful
  1. Sina Salam 16,531 Reputation points
    2025-01-24T16:29:58.1333333+00:00

    Hello Marques Chacon,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you would like to run a composed model with only one extraction algorithm.

    Putting into consideration the limitation that Azure Form Recognizer requires at least two unique extraction models in a composed model. I am providing you a feasible solution below by suggesting a programmatic approach to separate classification and extraction processes. Since you cannot set a confidence threshold for the null class directly in a composed model or reuse the same extraction model for multiple classifications.

    The best approach:

    1. Separate Classification and Extraction:
    • Use the Form Recognizer classification model to identify whether a document is "irrelevant" or "relevant."
    • Set a high confidence threshold in your application logic for the irrelevant/null class. Only proceed with extraction if the confidence for the relevant class is above a certain level.
    1. Single Extraction Model:
    • Train one extraction model for the relevant document type.
    • If the classification confidence indicates the document is relevant, run the document through the extraction model.
    • Skip the extraction step entirely for irrelevant documents.
    1. Alternative: You can duplicate the Extraction Model:
    • If you must use a composed model for classification and extraction combined, create a duplicate of your relevant extraction model.
    • Assign one to the relevant class and the other to the irrelevant/null class. Set the confidence threshold for the null class to a very high value (close to 1) in your composed model’s evaluation.

    Your implementation outline will be similar to the followings:

    • Train and publish a classification model.
    • Train and publish your extraction model for relevant documents.
    • Combine these models programmatically:
    • First, classify the document.
    • If classification confidence for the relevant class exceeds your threshold, run the document through the extraction model.
    • Skip processing for null/irrelevant documents.

    The reason this will work is simply because:

    • It separates concerns (classification vs. extraction) and gives you control over handling documents classified as null or irrelevant.
    • It avoids creating unnecessary complexity in the composed model and aligns with the current capabilities of Azure Form Recognizer.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    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.