Each receipt object comes with a set of data validation controls. it can be accessed under the attribute
from mindee import Client mindee_client = Client( expense_receipts_token="your_expense_receipts_api_token_here", raise_on_error=True ) parsed_data = mindee_client.parse_receipt("/path/to/file") print(parsed_data.receipt.checklist)
This sample code should print something like:
taxes_match_total_incl: Try to reconstruct the total amount including taxes with taxes line details and compare the result against the extracted total_incl field.
Mindee's algorithms extract all fields independantly, whatever the type of document. For example, they don't use the extracted taxes to reconstruct the total amounts. This way, when trying to reconstruct some fields from others with post-processing and comparing them to raw extracted fields, it's very unlikely to get a matching reconstruction although the predictions were wrong.
from mindee import Client mindee_client = Client( expense_receipts_token="your_expense_receipts_api_token_here", raise_on_error=True ) receipt_data = mindee_client.parse_receipt("path/to/file") if receipt_data.receipt.checklist["taxes_match_total_incl"] is True: # We are sure that taxes and total_incl fields were extracted correctly pass
mindee library will enforce probabilities to 1 for each field involved in validated check.