Share via

Read adls .pdf file through formrecognizer

CzarR 316 Reputation points
2022-08-03T23:02:30.503+00:00

Hi, I have been trying to read a pdf file using formrecognizer using python/pyspark inside databricks notebook. I need help with reading the file syntax is only letting read file inside a url. When I try to pass the adls path I get "no such file or directory" error in this line " poller = document_analysis_client.begin_analyze_document_from_url("prebuilt-layout", formUrl)". Please help. Thanks in advance.

    import os  
    from azure.core.credentials import AzureKeyCredential  
    from azure.ai.formrecognizer import DocumentAnalysisClient  
      
    endpoint = "endpoint"  
    key = "key"  
  
formUrl = "file:\\dev-app\data\zPathology.pdf"  
  
    document_analysis_client = DocumentAnalysisClient(  
        endpoint=endpoint, credential=AzureKeyCredential(key)  
    )  
          
    poller = document_analysis_client.begin_analyze_document_from_url("prebuilt-layout", formUrl)  
    result = poller.result()  
      
Azure Document Intelligence in Foundry Tools
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,836 Reputation points
    2022-08-05T03:37:37.283+00:00

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.