Document Intelligence Prebuilt Invoice Model cannot recognize currency transacted
- Package Name: azure-ai-documentintelligence
- Package Version: 1.0.0b2
- Operating System: Windows
- Python Version: 3.10.9
Describe the bug The prebuilt invoice model does not recognize the currency transacted despite the currency code being explicitly available to be extract from the document. Instead, it gives unrealistic results like different currency codes from several countries. Can someone explain this occurrence?
Expected behavior Correct understanding of the document and currency (SGD).
Screenshots
Snapshot from the invoice I am running analysis on.
Additional context
This is the result I am getting from begin_analyze_document
InvoiceTotal
{'type': 'currency', 'valueCurrency': {'amount': 332.77, 'currencyCode': 'CAD'}, 'content': '332.77', 'boundingRegions': [{'pageNumber': 1, 'polygon': [7.4619, 9.8317, 7.8223, 9.8266, 7.8273, 9.9484, 7.4619, 9.9484]}], 'confidence': 0.839, 'spans': [{'offset': 1675, 'length': 6}]}
SubTotal
{'type': 'currency', 'valueCurrency': {'amount': 311.0, 'currencyCode': 'INR'}, 'content': '311.00', 'boundingRegions': [{'pageNumber': 1, 'polygon': [7.4619, 9.0348, 7.8172, 9.0297, 7.8172, 9.1617, 7.4619, 9.1515]}], 'confidence': 0.92, 'spans': [{'offset': 1430, 'length': 6}]}
TotalTax
{'type': 'currency', 'valueCurrency': {'amount': 21.77, 'currencyCode': 'INR'}, 'content': '21.77', 'boundingRegions': [{'pageNumber': 1, 'polygon': [7.5228, 9.2023, 7.8273, 9.1921, 7.8273, 9.3139, 7.5279, 9.3089]}], 'confidence': 0.919, 'spans': [{'offset': 1444, 'length': 5}]}
Thanks for the feedback, we’ll investigate asap.
Hi @galvangoh , thanks for contacting. Since the issue is from the prebuilt model, I'll talk to service team for help.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @YalinLi0312.
Hi @galvangoh , our service team will take over this issue and improve the underlying model. We'll update here once the issue has been fixed. Thanks
Hi there, thanks for attending to this issue. May I know when can I expect an update from the service team and how often are the underlying models improved? Thanks.
Depending on the model, we may update the underlying model each time we release a new API version (a few times a year), even if you specify the same API version. We have traced the issue to the quality of an internal model used by prebuilt invoice and will use this feedback to improve model training and underlying algorithm. However, as with any AI model, we cannot guarantee that the results will always be correct even after the update. As no action is needed from the SDK side, I will close this issue.
@bojunehsu So what is the issue with the prebuilt invoice model that is causing the currency from being wrongly detected and in several currency code? Does the document requires a field to explicitly says that the currency code is what it is? The model's confidence in extracting the currency code is quite high as well (around 80%-90%). But the results just doesn't make sense and unusable.
@bojunehsu I'm re-opening five @galvangoh replied again to the issue.
Hi @galvangoh. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
As with many machine learning models, a fundamental reason for the missed currency symbol detection is due to insufficient/mismatched training data that aligns with the style of the test document. The model does not require an explicit field to indicate the overall currency code, though we do try to infer a global current code based on various signals for fallback when we fail to extract a currency symbol next to the currency value. Our confidence model currently does not focus sufficiently on the correctness of the currency code. This is something we aim to improve over time.
Hi @galvangoh, our service team will work on your requests. This issue is not for Python SDK, as our library works correctly in your end. In this case, I'll close this one.
Thanks
Hi @YalinLi0312 @bojunehsu thanks for attending to this issue.