Composed document intelligence models in Azure AI Document Intelligence allow you to combine multiple custom models into a single unified model that can analyze different document types. This powerful feature enables organizations to handle diverse document processing scenarios with a single API ca…Composed document intelligence models in Azure AI Document Intelligence allow you to combine multiple custom models into a single unified model that can analyze different document types. This powerful feature enables organizations to handle diverse document processing scenarios with a single API call.
When creating composed models, you first build individual custom models trained on specific document types. For example, you might have separate models for invoices, receipts, and purchase orders. Each custom model learns the unique structure and fields of its respective document type.
To create a composed model, you use the Azure AI Document Intelligence Studio or the REST API. The process involves selecting existing custom models and combining them into a new composed model. The composed model can contain up to 200 individual custom models, providing extensive flexibility for complex document processing workflows.
When a document is submitted to a composed model for analysis, the service automatically determines which component model best matches the input document. This classification happens based on the document structure and content patterns. The appropriate model then extracts the relevant fields and returns the results along with a confidence score indicating which model was used.
Key benefits of composed models include simplified client applications since only one model ID needs to be managed, reduced API complexity, and streamlined document processing pipelines. Organizations can add new document types by training additional custom models and incorporating them into the existing composed model.
Best practices include ensuring each component model is well-trained with sufficient sample documents, testing the composed model with various document types to verify correct model selection, and monitoring confidence scores to identify potential classification issues. You should also consider organizing related document types together and maintaining clear naming conventions for component models to facilitate management and troubleshooting of your composed document intelligence solutions.
Creating Composed Document Intelligence Models
Why is This Important?
Composed document models are a powerful feature in Azure AI Document Intelligence that allows you to combine multiple custom models into a single model endpoint. This is essential for scenarios where documents vary in format but need to be processed through a unified pipeline. For the AI-102 exam, understanding composed models demonstrates your ability to design scalable document processing solutions.
What Are Composed Document Intelligence Models?
A composed model is a collection of custom models grouped together under a single model ID. When a document is submitted for analysis, the composed model automatically identifies which custom model best matches the document and routes it accordingly. You can combine up to 200 custom models into a single composed model.
Key characteristics include: - Single endpoint for multiple document types - Automatic document classification and routing - Simplified application architecture - Support for both template and neural custom models
How It Works
Step 1: Create Individual Custom Models First, you need to train separate custom models for each document type you want to process. Each model should be trained on its specific document format (invoices, receipts, contracts, etc.).
Step 2: Compose the Models Using the Azure portal, REST API, or SDK, you combine the trained models into a composed model. The process involves: - Specifying the model IDs to include - Assigning a unique composed model ID - Optionally providing a description
Step 3: Analyze Documents When you submit a document to the composed model endpoint, Document Intelligence evaluates the document against all component models and returns results from the best-matching model along with a confidence score.
Code Example (Python SDK):
from azure.ai.formrecognizer import DocumentModelAdministrationClient client.begin_compose_document_model( component_model_ids=["model1", "model2", "model3"], model_id="composed-model" )
Exam Tips: Answering Questions on Creating Composed Document Intelligence Models
1. Remember the Limits: A composed model can contain up to 200 custom models. Questions may test your knowledge of these constraints.
2. Understand Use Cases: Composed models are ideal when you have multiple document formats that need processing through a single application endpoint. Look for scenarios describing varied document types.
3. Know the Prerequisites: All component models must be in the same Azure region and resource before they can be composed together.
4. Confidence Scores: The composed model returns results from the model with the highest confidence match. Expect questions about how document routing decisions are made.
5. Model Types: You can compose both template-based and neural custom models together. However, prebuilt models cannot be added to composed models.
6. API and SDK Knowledge: Be familiar with the begin_compose_document_model method and the required parameters like component_model_ids and model_id.
7. Distinguish from Classification Models: Composed models perform implicit classification during analysis. Custom classification models are separate and used when you need explicit document classification before extraction.
8. Watch for Distractors: Questions may include options about prebuilt models or suggest combining models across different resources, which is not supported.