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

FormRecognizer SDK not returning the correct value. [BUG] #42505

Open
ameenabdullah opened this issue Mar 7, 2024 · 8 comments
Open

FormRecognizer SDK not returning the correct value. [BUG] #42505

ameenabdullah opened this issue Mar 7, 2024 · 8 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 Workflow: 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

Comments

@ameenabdullah
Copy link

Library name and version

Azure.AI.FormRecognizer (4.1.0.0)

Describe the bug

When analyzing the document (custom model) via SDK, it's not returning the correct value. However, when using Studio, it analyzes the values properly. As an example: The value on the document is "Republic of X", which is being analyzed correctly using the Studio, however the SDK returns only "Republic" and missing the rest of the value.

Expected behavior

The SDK should return the value as being shown in the Studio.

Actual behavior

The SDK is not returning the full value.

Reproduction Steps

Upload a document in Document Intelligence Studio and analyze the values.
Use SDK to extract the values from same document.

Environment

No response

@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-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 7, 2024
@jsquire jsquire added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-team-triage Workflow: This issue needs the team to triage. labels Mar 7, 2024
@jsquire
Copy link
Member

jsquire commented Mar 7, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@tjoudeh
Copy link

tjoudeh commented Mar 10, 2024

To add to the same issue reported by @ameenabdullah, the Content property returned in the Azure.AI.FormRecognizer.DocumentAnalysis.AnalyzeResult contains the correct value "Republic of Turkiye" but the Content property returned in the Azure.AI.FormRecognizer.DocumentAnalysis.DocumentField containes the value "Republic". You can check the debug values in the image below:
image

@kinelski
Copy link
Member

Hello.

Please note that Azure.AI.FormRecognizer 4.1.0 targets service version 2023-07-31 by default. Could you confirm if that's the same version you're using in the Studio?

@kinelski kinelski added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Mar 12, 2024
Copy link

Hi @ameenabdullah. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@kinelski
Copy link
Member

kinelski commented Mar 12, 2024

In case you need to target newer service versions (2023-10-31-preview or 2024-02-29-preview), you'll need to migrate to the new Azure.AI.DocumentIntelligence package. Azure.AI.FormRecognizer won't be updated anymore.

For more information: README
Also check our migration guide: Migration Guide

@ihabdamen
Copy link

Hello @kinelski,

To add to the same issue faced by @ameenabdullah

We are using the studio version is 2023-07-31 and the SDK is 4.1.0, The Model is a template Model because Neural model is not supported yet in Qatar Region

image

@kinelski
Copy link
Member

To add to the same issue reported by @ameenabdullah, the Content property returned in the Azure.AI.FormRecognizer.DocumentAnalysis.AnalyzeResult contains the correct value "Republic of Turkiye" but the Content property returned in the Azure.AI.FormRecognizer.DocumentAnalysis.DocumentField containes the value "Republic". You can check the debug values in the image below: image

I'm just double checking in case you haven't noticed this, but the images show two different parts of the response.

In the REST API response you're looking at analyzeResult.Content, which in the SDK would be equivalent to doing:

AnalyzeDocumentOperation operation = client.AnalyzeDocument(...);
AnalyzeResult result = operation.Value;

// print the raw content
Console.Write(result.Content);

In the SDK print you're extracting the value from AnalyzeResult.Documents[...].Fields["Nationality"].Content.

Can you confirm that you're getting a different response in the Studio when looking into the returned fields? If the SDK behavior is correct, the JSON response should look like this:

{
  ...
  "analyzeResult": {
    ...
    "documents": [
      {
        ...
        "fields": {
          ...
          "Nationality": {
            "type": "string",
            "content": "Republic",
            ...
          }
        }
      }
    ]
  }
}

@ameenabdullah
Copy link
Author

Hello @kinelski
Below please find the response from JSON extracted from the Studio:

image
image
image

and the screenshot from Studio:

Screenshot 2024-03-18 125519

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Mar 18, 2024
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 Workflow: 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
Projects
None yet
Development

No branches or pull requests

5 participants