Want to be confident in the data extraction results?
You may want to get the advantage of the Veryfi confidence details for extracted parameters. Please note, that by default this option is not enabled for user accounts, if your use case requires confidence details, please contact support@veryfi.com to enable that.
Once enabled, all you need to do is to add confidence_details
parameter to your request. For v7 {"confidence_details" : 1}
For v8 {"confidence_details" : true}
API v8 is the current production version /api/v8/partner/documents
API v7 is the maintenance mode /api/v7/partner/documents
Let's look closer at how to interpret the JSON response including the score for total
field:
"total": {
"ocr_score": 1.0,
"score": 0.74,
"value": 147.38
},
How to read score:
"ocr_score"
- The probability that value 147.38 is extracted correctly
"score"
- The probability that value 147.38 is "total"
"value"-
147.38
How to interpret score:
"ocr_score": 1.0,
1 = 100%
"score": 0.74 ,
0.74 = 74%
💡 Pro Tip Flag documents for manual verification if the score is below 0.7
You may notice that for some fields the system returns the score for some it does not
Below is the explanation of why JSON responses may vary:
1. The system returns both "ocr_score" , "score", "value"
The data extracted from the document and can be found on the document image.
e.g: "date", "invoice_number", "total", etc.
"date": {
"ocr_score": 1.0,
"score": 0.95,
"value": "2021-09-01 00:00:00"
},
OR
"total": {
"ocr_score": 1.0,
"score": 0.74,
"value": 147.38
},
*Applicable for both v7 and v8
2. The system returns "score"
only
Some fields have only "score" which either means that the value of this field was not extracted from the document but rather inferred from the whole document data.
e.g: "category", "currency_code", "vendor_type", etc.
"default_category": {
"score": 0.87,
"value": "Job Supplies"
},
OR
"document_type": {
"score": 0.85,
"value": "invoice"
},
*Applicable for v7 only
Exceptions for v7
3. The system returns an empty value and no score
(a) System doesn't return the score for this particular parameter because this field doesn't support confidence scores.
"barcodes": [],
*Please find the full list of supported parameters below.
(b) The system returns an empty value for the parameter that supports confidence scores. In case most likely the data for this parameter was not found in the document by the model.
"due_date": "",
Due_date is missing in the Invoice sample.
4. The system returns the value for the parameter that supports confidence scores but without the score.
"subtotal": 133.98
We may assume that in this case score for “subtotal” could not be returned due to poor image quality or it was not found. In this case, most likely "subtotal" was calculated on the post-processing level.
Exceptions for v8
3. The system returns an empty value and no score
(a) System doesn't return the score for this particular parameter because this field doesn't support confidence scores.
"barcodes": [],
*Please find the full list of supported parameters below.
(b) The system returns an empty value for the parameter that supports confidence scores. In case most likely the data for this parameter was not found in the document by the model.
"due_date": "",
Due_date is missing in the Invoice sample.
4. The system returns the value for the parameter that supports confidence scores but without the score.
"total": 133.98
For v8 system will return a value only if the value of this field was not extracted from the document, but was enriched/calculated on the post-processing level.
e.g: the system failed to extract "total" and "total" was calculated on the post-processing level from the document context.
Have any questions? Please contact us at support@veryfi.com.
Other related Articles: