Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty documents fields of same image with data on studio #35583

Open
ArthurEgide opened this issue May 10, 2024 · 3 comments
Open

Empty documents fields of same image with data on studio #35583

ArthurEgide opened this issue May 10, 2024 · 3 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@ArthurEgide
Copy link

Package:

  • azure-ai-formrecognizer==3.3.0

OS:

  • Manjaro Linux
  • Ubuntu 22

Python 3.8.19

Description:

I used a document in Document Intelligence Studio and correctly got the data back.
Using the same document via the API or the Python SDK, the fields are not identified.

To Reproduce

  1. Take a PNG image;
  2. Use via Studio and successfully obtain the fields recognized with key/value;
  3. Use the same via Python SDK and have an empty result for the fields.

Expected behavior

Same result between Studio and SDK.

Screenshots

Both results were using the same image

Expected behavior successfully executed by Studio

Studio fields

Unexpected behavior successfully executed by Studio. Missing "Fields"

Python SDK fields

Used Snippet

# import libraries
import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.formrecognizer import DocumentAnalysisClient
import base64

with open("IMAGE_PATH", "rb") as image_file:
  readed_image = image_file.read()

endpoint = os.getenv('AZURE_ENDPOINT')
key = os.getenv('SUBSCRIPTION_KEY')

def analyze_invoice():
    document_analysis_client = DocumentAnalysisClient(
      endpoint=endpoint, 
      credential=AzureKeyCredential(key)
    )
    
    poller = document_analysis_client.begin_analyze_document(
        model_id="prebuilt-healthInsuranceCard.us", 
        document= readed_image
    )

    hci_us = poller.result()
    

    if(hci_us == None):
      return
    if hci_us.documents:
      
        for idx, az_document in enumerate(hci_us.documents):
          # Here the problem for any number of documents
          
          az_document.fields # EMPTY
          az_document.fields.get("Copays") # EMPTY, any key


if __name__ == "__main__":
    analyze_invoice()
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. labels May 10, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ctstone @vkurpad.

@swathipil
Copy link
Member

Hi @ArthurEgide - thanks for opening an issue! We'll take a look asap!

@ArthurEgide
Copy link
Author

Hello @swathipil, just adding information...

Even when I use the demonstrative image, the values are empty.

poller = document_analysis_client.begin_analyze_document_from_url(
  model_id="prebuilt-healthInsuranceCard.us",
  document_url='https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/rest-api/insurance-card.png'
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants