Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter Chunks_of_rows = []
- for line in text_blocks: # text_blocks is a json file
- lines = line['lines']
- for chunk in lines:
- bbox = chunk['bbox']
- for k,v in row_chunk.items():# k is the bbox and v is the number of times k appears.
- # So I want to append the k to a list and split the list to another list.
- # ie. if k appears ten times it should appends move to a new line after it appends the last object
- # print(k,v)
- if k == bbox[1]:
- span = chunk['spans']
- # print(span)
- for text in span:
- text = text['text']
- Chunks_of_rows.append(text)
- #Here is the bbox
- 82.32080078125
- 811.7716064453125
- 73.30280303955078
- 135.97779846191406
- 167.1802978515625
- 181.353515625
- 209.70013427734375
- 756.1480102539062
- 756.2940063476562
- 765.7479858398438
- 765.8939819335938
- 775.3480224609375
- 775.4940185546875
- 259.69671630859375
- 259.69671630859375
- 259.69671630859375
- 259.69671630859375
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 270.88531494140625
- 282.07379150390625
- 282.07379150390625
- 282.07379150390625
- 282.07379150390625
- 282.07379150390625
- 282.1163024902344
- 282.07379150390625
- 282.07379150390625
- 282.07379150390625
- 282.07379150390625
- 297.54833984375
- 315.3733215332031
- 315.3733215332031
- 315.3733215332031
- 315.3733215332031
- 315.3733215332031
- 315.3733215332031
- 315.3733215332031
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement