Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. enter Chunks_of_rows = []
  2. for line in text_blocks: # text_blocks is a json file
  3. lines = line['lines']
  4. for chunk in lines:
  5. bbox = chunk['bbox']
  6. for k,v in row_chunk.items():# k is the bbox and v is the number of times k appears.
  7. # So I want to append the k to a list and split the list to another list.
  8. # ie. if k appears ten times it should appends move to a new line after it appends the last object
  9. # print(k,v)
  10. if k == bbox[1]:
  11. span = chunk['spans']
  12. # print(span)
  13. for text in span:
  14. text = text['text']
  15. Chunks_of_rows.append(text)
  16. #Here is the bbox
  17.  
  18. 82.32080078125
  19. 811.7716064453125
  20. 73.30280303955078
  21. 135.97779846191406
  22. 167.1802978515625
  23. 181.353515625
  24. 209.70013427734375
  25. 756.1480102539062
  26. 756.2940063476562
  27. 765.7479858398438
  28. 765.8939819335938
  29. 775.3480224609375
  30. 775.4940185546875
  31. 259.69671630859375
  32. 259.69671630859375
  33. 259.69671630859375
  34. 259.69671630859375
  35. 270.88531494140625
  36. 270.88531494140625
  37. 270.88531494140625
  38. 270.88531494140625
  39. 270.88531494140625
  40. 270.88531494140625
  41. 270.88531494140625
  42. 270.88531494140625
  43. 270.88531494140625
  44. 282.07379150390625
  45. 282.07379150390625
  46. 282.07379150390625
  47. 282.07379150390625
  48. 282.07379150390625
  49. 282.1163024902344
  50. 282.07379150390625
  51. 282.07379150390625
  52. 282.07379150390625
  53. 282.07379150390625
  54. 297.54833984375
  55. 315.3733215332031
  56. 315.3733215332031
  57. 315.3733215332031
  58. 315.3733215332031
  59. 315.3733215332031
  60. 315.3733215332031
  61. 315.3733215332031
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement