-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[form recognizer] Remove US receipt #11764
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, mostly just want to hear back about receipt_type before approving
print("Tip: {} has confidence: {}".format(tip.value, tip.confidence)) | ||
total = receipt.fields.get("Total") | ||
if total: | ||
print("Total: {} has confidence: {}".format(total.value, total.confidence)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand wanting to show the keys available, but wondering if we should do at least one sample or readme like this:
for receipt in result:
for key, val in receipt.fields.items():
print("{}: {} has confidence: {}".format(key, val.value, val.confidence))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. I think I will leave the samples like this, but update the readme sample to traverse the fields like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like how the readme looks.
For this sample, I will suggest adding a comment on top a link to the types the service is currently supporting, or guiding the user into finding this information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the .NET sample, we're only showing a subset of illustrative values from the receipt.
Also, I'm not sure how it works in Python, but do you need to check the FieldValueType to cast these to the right time in order for a customer to use them in a scenario?
Co-authored-by: Krista Pratico <[email protected]>
…re-sdk-for-python into remove_us_receipt * 'remove_us_receipt' of https://github.com/iscai-msft/azure-sdk-for-python: fix typo in changelog
for name, field in receipt.fields.items(): | ||
if name == "Items": | ||
print("Receipt Items:") | ||
for idx, items in enumerate(field.value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's at all complicated to retrieve these values, it's probably worth illustrating for customers how to get them out of the receipt fields property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are still accessing the field properties (including items) one by one in the samples. For the readme, based on @kristapratico , I wanted to show a simpler way of traversing everything
fixes #11712