- Newest
- Most votes
- Most comments
The error you're encountering suggests there might be issues with how you've annotated your documents for Custom Query Adapter training. Here are some potential reasons for the "ERROR_INVALID_BLOCK_RELATIONSHIP" and steps you can take to resolve it:
-
Empty labels: While it's okay to leave some labels empty if the answer isn't present in the document, make sure you're not accidentally creating invalid relationships between blocks. Double-check that empty labels are truly meant to be empty and not a result of missed annotations.
-
Annotation format: Ensure that your annotations follow the correct format. For Custom Queries, annotations should follow the Amazon Textract Block structure, containing only QUERY and QUERY_RESULT blocks. Verify that your annotations adhere to this structure.
-
Consistency: Make sure your annotations are consistent across all documents. If you're labeling column names, ensure you're using the same approach for all similar documents.
-
Overlapping or conflicting annotations: Check if you have any overlapping or conflicting annotations that might cause invalid block relationships.
-
Review affected files: Focus on the 9 files mentioned in the validation_errors.jsonl. These are likely the source of the problem. Carefully review and re-annotate these documents if necessary.
-
Minimum requirements: Ensure you have at least 5 training documents and 5 testing documents properly annotated.
To resolve this issue:
- Review and correct the annotations in the 9 problematic files identified in the validation_errors.jsonl.
- Double-check all your annotations, paying special attention to consistency and proper formatting.
- Consider using the auto-labeling feature for your first training attempt, which might help avoid some common annotation errors.
- After making corrections, try training the adapter again.
If the problem persists after these steps, you may need to reach out to AWS support for more detailed assistance with your specific use case.
Sources
Preparing training and testing datasets - Amazon Textract
Customizing you Queries Responses - Amazon Textract
Custom Queries tutorial - Amazon Textract
validation_errors.jsonl
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802217_1_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802217_1.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802217_1_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/6121b07b48ac8238c0271bab536eb786c04eeb622426747de6ccd303780ff2bd/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TESTING", "include": true, "last-edited-time": 1727806769837, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 334717, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802217_2_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802217_2.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802217_2_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/b4ed6b7c2af0c6b2a28b908c2bbc780a1acdf445e0e72f29b71336f0620f7c5b/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TESTING", "include": true, "last-edited-time": 1727806802538, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 335055, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802264_1_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802264_1.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802264_1_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/6b173b846d198363963bf22afdc1783afeca67a4ba3c8731fa630fb0b800d740/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TESTING", "include": true, "last-edited-time": 1727807560888, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 333840, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802264_2_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802264_2.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802264_2_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/4ab31a685a0ce15c2d47efaa7c555cac8ac9e02732cc0d86a1486976501fb644/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TESTING", "include": true, "last-edited-time": 1727807570652, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 333539, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802488_1_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802488_1.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802488_1_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/a94cdb6380a77c26626971395f5e58a5140b936a7d74f13ba4c8972e730a3292/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TESTING", "include": true, "last-edited-time": 1727807582380, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 334192, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802314_1_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802314_1.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802314_1_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/612e149ae620e2ff317c2014c7bd672fd6c4e5d0eca040ae66809ff30aa7e316/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the price per unit of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the total price of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the tax rate of the listed items?", "query-type": "Raw text"}], "assignment": "TRAINING", "include": true, "last-edited-time": 1727805105061, "errors": [{"code": "ERROR_INVALID_BLOCK_RELATIONSHIP", "message": "Invalid block relationship(s) found."}]}, "console-metadata": {"labeling-type": "MANUAL", "file-size": 334093, "file-type": "pdf"}}
{"source-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/assets/RE24-0802353_1_1.pdf", "source-ref-version": "", "source-ref-metadata": {"origin-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/original_assets/RE24-0802353_1.pdf", "page-number": 1}, "annotations-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/annotations/RE24-0802353_1_1.pdf.json", "annotations-ref-version": "", "annotations-ref-metadata": {"prelabeling-refs": [{"prelabeling-ref": "s3://textract-adapters-us-east-1-1ad06f73-c616-41b5-95e8-8be613ceaf6/adapters/0a6dd6b69d69/prelabels/58b2bd80bfc35a18e083490f666c03a998874a3650cfeb46dbed431108af09ac/1", "prelabeling-ref-version": ""}], "annotation-status": "REVIEWED", "queries": [{"query-text": "What is the column name that contains the product code of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the product name of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the large quantity of the listed items?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the unit description of the large quantities (e.g. colli, box, package)?", "query-type": "Raw text"}, {"query-text": "What is the column name that contains the small quan
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 4 months ago