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

[QUERY] Azure Form Recognizer DocumentFieldType always returns Unknown but expecting DocumentFieldType.Double #41247

Closed
jlunarzewski opened this issue Jan 14, 2024 · 4 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. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@jlunarzewski
Copy link

jlunarzewski commented Jan 14, 2024

Library name and version

Azure.AI.FormRecognizer 4.0.0

Query/Question

Trying to map some values from Azure form recognizer Custom Extraction Model. Within Form Recognizer studio the field is type number -> not-specified. I would imagine this would map to the DocumentFieldType.Double within the C# library but it keeps returning as DocumentFieldType.Unknown. What is the correct way to map non-currency numeric values? Updating the library version to 4.1.0 does not help.

Here is the output json from the recognition for a field. I'd imagine it not having a valueNumber field might have something to do with it but I don't quite understand why it doesn't have one.

"WaterMeterReadingFrom": {
	"type": "number",
	"content": "2568",
	"boundingRegions": [
		{
			"pageNumber": 2,
			"polygon": [
				4.868,
				1.6141,
				5.1725,
				1.6141,
				5.1725,
				1.7562,
				4.868,
				1.7562
			]
		}
	],
	"confidence": 0.964,
	"spans": [
		{
			"offset": 1866,
			"length": 4
		}
	]
},

Environment

Windows 11 .NET7.0
JetBrains Rider 2023.3.2

@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 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 Jan 14, 2024
@pallavit
Copy link
Member

Tagging and routing to the member best able to assist you. /cc:@kinelski

@jsquire jsquire added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-team-triage This issue needs the team to triage. labels Jan 15, 2024
@kinelski
Copy link
Member

kinelski commented Jan 16, 2024

@jlunarzewski ,

The SDK exposes the field type as Unknown because it lacks a valueNumber, as you noticed. This means that the service was not able to parse it into a floating point value on their end. If you still want to extract it as a number, you can get the string representation of the field in DocumentField.Content and you will need to parse it on your side.

You can still get the expected field type from the DocumentField.ExpectedType property, which should be set to Double.

@kinelski kinelski added issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. and removed needs-team-attention This issue needs attention from Azure service team or SDK team labels Jan 16, 2024
Copy link

Hi @jlunarzewski. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

Copy link

Hi @jlunarzewski, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. 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

4 participants