Different results between Azure AI Document Intelligence Studio and .NET Client

110 views Asked by At

I've setup a Document Intelligence endpoint with the intent to use the Health Insurance Card (prebuilt-healthInsuranceCard.us) prebuilt model.

I started submitting sample documents using Azure.AI.FormRecognizer NuGet package in .NET, and noticed that the results were pretty bad, the biggest issue being that it does not identify the member ID.

Looking into it, I stumbled upon the Document Intelligence Studio, and found that it does a great job with the same sample files.

I noticed that the JSON response is different, and references a newer API version (2023-10-31-preview), which led me to finding the newer, in preview, Azure.AI.DocumentIntelligence NuGet package. Making the switch got me a response that looks more like that from Document Intelligence Studio, in that the API version now matches, but the overall results are still lacking (still no member ID).

Looking at developer tools, it seems the Azure AI Studio is calling the same endpoint I've configured in my .NET application. I can't figure out/don't understand why I'm getting different results from the two.

This is my AnalyzeDocumentAsync call, note the model ID:

var credential = new AzureKeyCredential(key);
var options = new AzureAIDocumentIntelligenceClientOptions(ServiceVersion.V2023_10_31_Preview);
var client = new DocumentIntelligenceClient(new Uri(endpoint), credential, options);

var fileBytes = await File.ReadAllBytesAsync(insuranceCardPath);

var content = new AnalyzeDocumentContent();
content.Base64Source = BinaryData.FromBytes(fileBytes);

var result = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-healthInsuranceCard.us", content, stringIndexType: StringIndexType.Utf16CodeUnit);

I'm setting the stringIndexType to Utf16CodeUnit, in an effort to perfectly match the Document Intelligence Studio behavior, because I noticed that it was doing the same thing.

0

There are 0 answers