JSON response detailed explanation
JSON Syntax Rules
Data is in name/value pairs
Data is separated by commas
Curly braces hold objects
Square brackets hold arrays
Skeleton of the JSON format
{
"id": "SAMPLE_ID",
"original_filename": "SAMPLE_ORIGINAL_FILENAME",
"inbox": "SAMPLE_INBOX",
"page_count": SAMPLE_PAGE_COUNT,
"prediction": {
"annotations": {},
"lines": {},
"sections": {},
},
"feedback": {
"annotations": {},
"sections": {},
"lines": {},
"name": "SAMPLE_NAME",
"source": "SAMPLE_SOURCE",
"is_evaluated": SAMPLE_IS_EVALUATED,
"timestamp": "SAMPLE_TIMESTAMP",
"flag_for_review": SAMPLE_FFR,
"document_fully_correct": SAMPLE_DFC,
"sections_fully_correct": []
},
"versions": {
"annotations": {},
"sections": {},
"lines": {},
"name": "SAMPLE_NAME",
"source": "SAMPLE_SOURCE",
"is_evaluated": SAMPLE_IS_EVALUATED,
"timestamp": "SAMPLE_TIMESTAMP",
"flag_for_review": SAMPLE_FFR,
"document_fully_correct": SAMPLE_DFC,
"sections_fully_correct": []
},
"files": [],
"usage_data": {},
"meta_information": {},
"flag_for_review": SAMPLE_FFR_VALUE,
"timings": {},
"lock": {},
"escalate": {},
"submitted": {},
"reject": {},
"last_version": null,
"status_data": {},
}
1 | Code | Description |
2 | { | Opening bracket for the entire JSON format |
3 | "id": "SAMPLE_ID", | Information on the universally unique identifier (UUID) of the file
|
4 | Information on the original file name including the extension
| |
5 | Information on the the universally unique identifier (UUID) of the inbox
| |
6 | Information on the total number of pages contained in the file
| |
7 | Information on the predictions made for the fields of the predicted document format The prediction is the information that is read and extracted automatically by the machine upon processing the uploaded file.
| |
8 | Information on the predictions made for any header field Per field prediction, we have the following pieces of information: field_name, text, confidence, version, value, upper_left, lower_right, and flag_for_review, included from line 2 until line 12. The same structure will appear for each field prediction made.
| |
9 | Information on the predictions made for any line-item field Per line-item field prediction, we have the following pieces of information: table_name, field_name, text, value, confidence, upper_left, lower_right, and flag_for_review, included from line 2 until line 12. The same structure will appear for each line-item field prediction made.
| |
10 | Information on the split sections of the file One file (ex: pdf) can contain more than one document (ex: invoice) with multiple pages (page: 0, 1, 2, etc.). One section is a logical group of pages that make up one document. Per section, we have the following pieces of information: page, document_type, format, confidence, version, and flag_for_review, included from line 2 until line 9. The same structure will appear for each document section predicted.
| |
11 | Closing bracket for | |
12 |
| Information on the feedback made for the fields of the predicted document format The feedback is the information sent from the human reviewer to the machine. This information is used for the evaluation of statistics.
|
13 | Information on the feedback made for any header field Per field feedback, we have the following pieces of information: field_name, text, gold (for FE feedback), visual_coord, textual_coord, confidence (only for GET), evaluation (only for GET), and flag_for_review (only for GET), included from line 2 until line 12. The same structure will appear for each field feedback made. When feedback is sent from the front-end, we will have one annotation feedback for all of the fields in the format, even if we send empty feedback (TP, TN, FP, FN). When feedback is sent from the back-end, we will only have annotation feedback for all of the fields which we explicitly post feedback for.
| |
14 |
| Information on the feedback of split sections of the file Per section feedback, we have the following pieces of information: page, document_type, format, confidence, evaluation, and flag_for_review, included from line 2 until line 8. The same structure will appear for each document section predicted.
|
15 | Information on the feedback made for any line-item field Per line-item field feedback, we have the following pieces of information: field_name, text, value, visual_coord, textual_coord, confidence, evaluation, row_to_line and flag_for_review, included from line 6 until line 14. The same structure will appear for each line-item field prediction made within the same table. For field feedback in a new table, lines 3 until line 5 will appear before the individual feedbacks of all line-items that belong to the same table appear.
| |
16 |
| Information on the feedback name
Information on the source of the feedback
Information on whether the feedback is evaluated (a copy of the VERSIONS section)
Information on the timestamp of the feedback
Information on flag for review (a copy of the VERSIONS section)
Information on the document accuracy based on the feedback (a copy of the VERSIONS section)
Information on the sections being fully correct (a copy of the VERSIONS section)
|
17 | Closing bracket for | |
18 |
| Information on all the versions made for the fields of the predicted document format All versions include the initially predicted versions and all feedback versions.
|
19 | Cf. rows #8 and #13 | |
20 | Cf. rows #10 and #14 | |
21 | Cf. rows #9 and #15 | |
22 | Cf. row #16
| |
23 | Closing bracket for | |
24 | Information on the files attached Per file included in the main file, we have the following pieces of information: filename, page, page_count, filehash, leaf, and embedded_attachment, included from line 2 until line 9. The same structure will appear for each file included in the main file. A main file can be for example an email, while an embedded image inside the email body and a PDF file attached to the email are files contained in the main file.
| |
25 | Information on the usage data of the file This information only appears once for the whole JSON file. It pertains to the volume statistics of the file and it is created automatically upon upload. This information is however updated and replaced by the volume statistics of any newer reprocessed version of the file.
| |
26 | Information on the meta info of the file This is a wildcard attribute, more specifically for internal use. This is where more custom or extra information is kept. Usually, the reference_field is contained in this attribute, however there can also be other fields.
| |
27 | Information on the FFR attribute
| |
28 | Information on the timings of the whole document
| |
29 | Information on the lock attribute
| |
30 | Information on the escalate attribute
| |
31 | Information on the submit attribute
| |
32 | Information on the reject attribute
| |
33 | Information on the last_version attribute
| |
34 | Information on the status data of the whole document considering
| |
35 |
| Closing bracket for the entire JSON format |