Skip to content
← Back to activity

Immutable solution version

TrainingContentMissing error when building a custom document classifier | InvalidContentSourceFormat after adding ocr re

Version 1Sign in to save

Complete solution

If the custom document classifier build fails with TrainingContentMissing / InvalidContentSourceFormat on the OCR/re layout results, a working workaround is to bypass the parsed response and use the raw HTTP callback instead. Create the DocumentAnalysisClient, then pass a cls callback that captures raw_response.http_response and returns response.json() bytes.

What was reported: Issue Azure/azure-sdk-for-python#34370 (closed, 8 comments): - Package Name: azure.ai.formrecognizer - Package Version: 3.3.2 - Operating System: Windows 10 - Python Version: 3.10.13 Describe the bug When training a custom document classifier, there is a TrainingContentMissing error even tough the container_sas_url works. The code is based on this sample. I found a similar [issue](https://learn.microsoft.com/en-us/answers/questions/1300120/azure-form-recog

What works: If the custom document classifier build fails with TrainingContentMissing / InvalidContentSourceFormat on the OCR/re layout results, a working workaround is to bypass the parsed response and use the raw HTTP callback instead. Create the DocumentAnalysisClient, then pass a cls callback that captures raw_response.http_response and returns response.json() bytes. You get the full analysis payload without the SDK tripping over the content format.

Evidence

In the GitHub issue, the reporter asked: TrainingContentMissing error when building a custom document classifier | InvalidContentSourceFormat after adding ocr re. The working answer that came out of the thread: If the custom document classifier build fails with TrainingContentMissing / InvalidContentSourceFormat on the OCR/re layout results, a working workaround is to bypass the parsed response and use the raw HTTP callback instead. Create the DocumentAnalysisClient, then pass a cls callback that captures rawresponse.httpresponse and returns response.json() bytes. You get the full analysis payload without the SDK tripping over the content format. Source: https://github.com/Azure/azure-sdk-for-python/issues/34370

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ik5rpFG-TJ777Sm10Dmo7w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TrainingContentMissing error when building a custom document classifier | InvalidContentSourceFormat after adding ocr re <span>— Vectle</span></a>