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.

[QUERY] FormRecognizer - Serialization for RecognizedFormCollection

See original GitHub issue

Query/Question What is the correct way to handle serializing/deserializing Form Recognizer responses to and from JSON format using the Azure SDK? I am using Newtonsoft and attempting to serialize the RecognizedFormCollection for future processing as the FormField class contains methods to operate on the data that is loaded into the model, however, the class constructors are marked internal and as such cannot be deserialized directly. What is the correct way to handle this scenario?

https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/formrecognizer/Azure.AI.FormRecognizer/src/RecognizedFormCollection.cs

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0] Form Recognizer 3.2
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8] .NET 5
  • IDE and version : [e.g. Visual Studio 16.3] VS2019

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
saucepleezcommented, Jun 22, 2021

Hello,

No. What I am trying to do is execute Form Recognizer which returns a RecognizedFormCollection. Once I have that object, I would like to export it as a json string somewhere (ex. Json File) as I will need to process it at a later time. Once I decide later on to to process it, I would like to deserialize the json back into a new RecognizedFormCollection and then use the methods such as field.Value.GetConvertedValue(); to pull out the values.

Given that RecognizedFormCollection does not support constructors, how am I supposed to load the data into the class properly?

5reactions
maririoscommented, Sep 13, 2021

Recreating the structure of RecognizedForm is not ideal.

For sure. That is why the SDK is in charge of that. So the user doesn’t have to.

I am re-opening the issue and will add it to triage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accelerate web forms using Azure Form Recognizer client ...
This blog post will demonstrate how Azure Form Recognizer client ... Here's a list of properties you can query on the RecognizedForm class....
Read more >
deserialize RecognizedForm object from json (Azure Form ...
I need to deserialize json-serialized Azure Form Recognizer results into python FormRecognizer objects (from azure-ai-formrecognizer==3.1.0b1 ...
Read more >
Class RecognizedFormCollection | Azure SDK for .NET
A read-only collection of RecognizedForm objects. Inheritance. System.Collections.ObjectModel.ReadOnlyCollection. RecognizedFormCollection. Namespace: System.
Read more >
The Latest Model Updates in Azure Form Recognizer - YouTube
Resources: Form Recognizer Studio https ... updates to existing models like the new query fields based on OpenAI models and key ...
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