1095A US Tax form is not working with python

Muhammad 20 Reputation points
2025-04-25T18:35:30.62+00:00

I am not able to analyze 1095A &C models with the follwoing code.

from azure.core.credentials import AzureKeyCredential
from azure.ai.formrecognizer import DocumentAnalysisClient
from azure.ai.documentintelligence.models import AnalyzeResult
file_path = "Tax1095A.example.fdx.pdf"

model_id = "prebuilt-tax.us.1095A"
document_analysis_client = DocumentAnalysisClient(
    endpoint=endpoint, credential=AzureKeyCredential(key)
)

with open(file_path, "rb") as f:
    poller = document_analysis_client.begin_analyze_document(model_id, document=f)
    result: AnalyzeResult = poller.result()

Error that I am getting:

ResourceNotFoundError: (NotFound) Resource not found.
Code: NotFound
Message: Resource not found.
Inner error: {
    "code": "ModelNotFound",
    "message": "The requested model was not found."
}
Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
2,026 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247 32,531 Reputation points MVP
    2025-04-27T06:47:01.29+00:00

    azure doc Intelligence provides limited prebuilt models like prebuilt-invoice, prebuilt-receipt, prebuilt-businessCard, prebuilt-idDocument, prebuilt-tax.us.w2 (for W-2 forms), etc. There is no prebuilt model for 1095-A forms like 'prebuilt-tax.us.1095A', only W-2 exists under tax forms. Use prebuilt-document, or build your own custom model.


  2. Manas Mohanty 3,210 Reputation points Microsoft External Staff
    2025-04-29T16:04:41.3433333+00:00

    Hi Muhammad

    Sorry for the inconvenience. Attached cause and solution for reference.

    Cause

    The issue here is the syntax used below is from3.3 version of document intelligence and prebuilt-tax.us.1095A model is not available in 3.0 version but 4.0 version instead.

    #pip install azure-ai-formrecognizer==3.3.0
    
    with open(file_path, "rb") as f: poller = document_analysis_client.begin_analyze_document(model_id, document=f) result: AnalyzeResult = poller.result()
    
    
    

    Solution

    Please install 4.0 version with below command and use 4.0 syntax

    pip install azure-ai-documentintelligence==1.0.0b4
    
    

    4.0 syntax

    import os from azure.core.credentials import AzureKeyCredential 
    from azure.ai.documentintelligence import DocumentIntelligenceClient 
    from azure.ai.documentintelligence.models import AnalyzeResult 
    from azure.ai.documentintelligence.models import AnalyzeDocumentRequest
    
    document_intelligence_client  = DocumentIntelligenceClient(
        endpoint=endpoint, credential=AzureKeyCredential(key)
    )
    
    with open(file_path, "rb") as f:
    
        poller = document_intelligence_client.begin_analyze_document(
        "prebuilt-tax.us.1095A", body=f)
    
    
    w2s = poller.result()
    

    Reference on un-availability of 1095A US Tax form in 3.1 document intelligence

    Reference on availability of 1095A US Tax form in 4.0 document intelligence.

    Please let us know if it fixes the issue and requesting to re-take the survey on this answer.

    Thank you

    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.