Extraction of Layout List from the AWS Textract

21 Views Asked by At

I got response from the AWS textract with the BlockType as LAYOUT_LIST. How to filter its response so that I get the each element of this list?

Response Sample:

{
      "BlockType": "LAYOUT_LIST",
      "Confidence": 92.1875,
      "Geometry": {
        "BoundingBox": {
          "Width": 0.7263423800468445,
          "Height": 0.7704609632492065,
          "Left": 0.10927136987447739,
          "Top": 0.1281854659318924
        },
        "Polygon": [
          {
            "X": 0.10927136987447739,
            "Y": 0.12851490080356598
          },
          {
            "X": 0.8344610929489136,
            "Y": 0.1281854659318924
          },
          {
            "X": 0.8356137275695801,
            "Y": 0.8984608054161072
          },
          {
            "X": 0.11016831547021866,
            "Y": 0.8986464142799377
          }
        ]
      },
      "Id": "2cdabdce-6906-4d4c-ab61-1add8501bc45",
      "Relationships": [
        {
          "Type": "CHILD",
          "Ids": [
            "6d8f05f5-8762-4b26-a99b-bed1317886f8",
            "f9b33711-0684-48c9-9700-a062783e3c7b",
            "1b81ffe2-b091-4b7b-a72f-dd55587ed3d6",
            "d5642e4a-3062-4195-aa4a-5339be37bc9a",
            "76387c40-cabc-40ea-969a-1fdb7312e924",
            "7f58acd2-d360-4030-9d2d-ff6bcf6b7d9c",
            "2eddce4d-fb5d-4d44-b3e7-22a104a199ac",
            "f13a0531-571d-4dbc-b163-1ac8424e376e",
            "543d37d8-67fd-4048-b6a7-97053f9f3641",
            "e329b4db-3752-483a-a734-89420e7df490",
            "dd702cbb-db59-45be-82a3-8eb4156ec584",
            "66334bba-018e-49a7-b020-ceb655a1af55",
            "d779433b-7d79-4162-b030-754c6340f6f3"
          ]
        }
      ],
      "Page": 1
    },
    {
      "BlockType": "LAYOUT_TEXT",
      "Confidence": 95.41015625,
      "Geometry": {
        "BoundingBox": {
          "Width": 0.720550537109375,
          "Height": 0.04754047095775604,
          "Left": 0.11363732069730759,
          "Top": 0.12818562984466553
        },
        "Polygon": [
          {
            "X": 0.11363732069730759,
            "Y": 0.1285129189491272
          },
          {
            "X": 0.8341171741485596,
            "Y": 0.12818562984466553
          },
          {
            "X": 0.8341878056526184,
            "Y": 0.1754075586795807
          },
          {
            "X": 0.11369240283966064,
            "Y": 0.17572610080242157
          }
        ]
      },
      "Id": "6d8f05f5-8762-4b26-a99b-bed1317886f8",
      "Relationships": [
        {
          "Type": "CHILD",
          "Ids": [
            "36dc4e4a-cbb7-46f1-9a67-4bc891449be4",
            "a58dc745-43d2-4b9c-ab6d-2b2ea85fa0fc",
            "b5183578-e43f-41ce-9a39-2196635aa926",
            "6e364d27-4f18-4708-8c79-ed35b836ebe4"
          ]
        }
      ],
      "Page": 1
    },
    {
      "BlockType": "LAYOUT_TEXT",
      "Confidence": 95.947265625,
      "Geometry": {
        "BoundingBox": {
          "Width": 0.7226269841194153,
          "Height": 0.047366075217723846,
          "Left": 0.11200323700904846,
          "Top": 0.19415682554244995
        },
        "Polygon": [
          {
            "X": 0.11200323700904846,
            "Y": 0.1944727748632431
          },
          {
            "X": 0.8345597982406616,
            "Y": 0.19415682554244995
          },
          {
            "X": 0.8346302509307861,
            "Y": 0.24121569097042084
          },
          {
            "X": 0.11205809563398361,
            "Y": 0.2415228933095932
          }
        ]
      },
      "Id": "f9b33711-0684-48c9-9700-a062783e3c7b",
      "Relationships": [
        {
          "Type": "CHILD",
          "Ids": [
            "545c8693-8f46-4cda-95e7-250662ed9e17",
            "0b0fd1d0-866a-45d9-a721-51ce4424df0d",
            "7a359a18-4276-4787-be09-58c87c6de132",
            "117dcb80-92b8-4475-8980-dce886e92088"
          ]
        }
      ],
      "Page": 1
    }

I want list elements that comes under BLOCK_TYPE as LAYOUT_LIST

0

There are 0 best solutions below