Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
The error is most likely caused by a missing prerequisite for training a custom classification model rather than by document size or count.
For custom classification in Azure Document Intelligence v4.0, each training document must have corresponding layout model results stored alongside it. When training via Studio, if layout results are not present, Studio will try to run the layout model for every document. That background layout run can be throttled and fail, which surfaces as generic internal errors.
To unblock training:
- Ensure minimum dataset requirements
- At least two classes.
- At least five documents per class.
- Word, PowerPoint, Excel, PDF, or image formats are supported; having at least one sample of each format used per class is recommended.
- Pre‑generate layout results for all training documents
- In Document Intelligence Studio, open the Layout model.
- Run the layout model on each training document.
- Download or save the layout results and upload them to the same location as the original document (same folder, same storage container) so that each document has its corresponding layout JSON.
- Verify layout result format
- Layout results must be the raw layout API response, not the SDK object model.
- When training via SDK/API, place these layout JSON files in the folders that contain the individual documents.
- Retry training the classifier
- After all documents have layout results in place, start training the custom classification model again (via Studio or API).
If training still fails with the same internal error after layout results are correctly added, check for regional service issues (Service Health) and, if needed, try training in another region or open a support case, as the remaining cause is likely service-side.
References: