Hello Tirgar, Ashkan,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are facing difficulties in reliably identifying wage stubs within a mixed set of documents using Azure AI Document Intelligence, especially given the impracticality of training a custom classifier on the many variations of wage stubs.
This is not just about clarifying whether composed models can combine prebuilt and custom models simply because they cannot, but also about showing you the best-practice workflow to achieve your goal without retraining on known formats. Microsoft’s documentation confirms that composed models in Azure Document Intelligence are designed only for combining custom models, so prebuilt models such as prebuilt-payStub.us
must be integrated through orchestration in your application logic rather than within the Studio interface itself.
Therefore, the most reliable architecture is a two-stage classification and extraction pipeline. In this approach, your application first calls the prebuilt pay stub model (prebuilt-payStub.us
– docs), which returns docType
, confidence
, and per-field confidence values in the Analyze response. You then apply a calibrated confidence threshold based on your own validation data (Microsoft recommends deriving this from accuracy confidence baselines, not using a fixed universal number) and check for coverage of key pay stub fields such as Employee, Employer, PayPeriod, GrossPay, and NetPay. If the document-level confidence and field coverage meet your criteria, you accept it as a pay stub; otherwise, you route it to your custom classifier or composed custom extraction models for further processing.
This method ensures that known document types like pay stubs benefit from the robustness of Microsoft’s prebuilt models, while the rest of your corpus is handled by a tailored classifier trained on your actual document types. For ongoing accuracy, you should set up confidence-based routing rules, implement a review queue for low-confidence cases, and leverage incremental training on your custom classifier as new document types emerge (custom classification docs). Below is a simplified orchestration pattern you can adapt:
result = client.analyze_document("prebuilt-payStub.us", document)
doc = result.documents[0] if result.documents else None
if doc and doc.confidence >= PAYSTUB_THRESHOLD and coverage_ok(doc.fields):
return "PayStub", doc
else:
return classify_with_custom_model(document)
By following this confidence-and-coverage-based decision flow, you avoid the pitfalls of trying to compose prebuilt and custom models directly, maintain accuracy across document types, and ensure your pipeline is both scalable and easy to maintain.
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.