question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Azure Form Recognizer Prebuilt Business Card Template code.

See original GitHub issue

Library name and version

Azure Form Recognizer (2022-08-31) (GA)

Describe the bug

Template Prebuilt Business Card operations with the Azure Form Recognizer client library code a bug AsList() , AsDictionary() , AsString()

example

ContactNamesField.AsList() contactNameField.AsDictionary(); firstNameField.AsString();

foreach (DocumentField contactNameField in **ContactNamesField.AsList()**)

  if (contactNameField.**ValueType** == DocumentFieldType.Dictionary)                
{
                    IReadOnlyDictionary<string, DocumentField> contactNameFields = **contactNameField.AsDictionary();**

                    if (contactNameFields.TryGetValue("FirstName", out DocumentField firstNameField))
                    {
                        if (firstNameField.ValueType == DocumentFieldType.String)
                        {
                            string firstName **= firstNameField.AsString();**

Expected behavior

Template Prebuilt Business Card operations with the Azure Form Recognizer client library code must be changed as
AsList() , AsDictionary() , AsString() convert from Value field.

ContactNamesField.Value.AsList() contactNameField.Value.AsDictionary() firstNameField.Value.AsString()

 foreach (DocumentField contactNameField in **ContactNamesField.Value.AsList()**)
                        {
                            Console.WriteLine("Contact Name: ");

                            if (contactNameField.FieldType == DocumentFieldType.Dictionary)
                            {
                                IReadOnlyDictionary<string, DocumentField> contactNameFields = **contactNameField.Value.AsDictionary()**;

                                if (contactNameFields.TryGetValue("FirstName", out DocumentField firstNameField))
                                {
                                    if (firstNameField.FieldType == DocumentFieldType.String)
                                    {
                                        string firstName = **firstNameField.Value.AsString()**;
                                    }
                                }

Actual behavior

https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard

Reproduction Steps

https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard

Refer Code area and select C#

Environment

https://formrecognizer.appliedai.azure.com/studio/prebuilt?formType=businessCard

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kinelskicommented, Apr 17, 2023

@rvinothrajendran @adreno-abhi The samples in Form Recognizer Studio have been fixed. Feel free to update this issue if you think we missed anything.

1reaction
jsquirecommented, Oct 2, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Recognizer API (v2.1) - Cognitive Services - Microsoft
Business Card - Detects and extracts data from business cards using optical character recognition (OCR) and our business card model, enabling you to...
Read more >
Azure Form Recognizer - Microsoft Q&A
I am training the custom model (Template) in Azure Form recognizer. The scenario is a form with 5 fields - first name, last...
Read more >
Azure Form Recognizer client library for .NET - version 4.1.0
Prebuilt - Analyze data from certain types of common documents using prebuilt models. Supported documents include receipts, invoices, business ...
Read more >
How to guide: create and compose custom models ...
Compose several custom models into a single model for easier data extraction from groups of distinct form types. Use the custom template ......
Read more >
What's new in Azure AI Document Intelligence?
Form Recognizer is now Azure AI Document Intelligence! Document, Azure AI ... Prebuilt business card now includes Japanese language support.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found