sheikh commited on
Commit
d70cb6f
·
1 Parent(s): c04ef71

Update SLR.py

Browse files
Files changed (1) hide show
  1. SLR.py +2 -1
SLR.py CHANGED
@@ -100,6 +100,7 @@ class SLR(datasets.GeneratorBasedBuilder):
100
  ann_dir = os.path.join(filepath, "annotations")
101
  img_dir = os.path.join(filepath, "images")
102
  for guid, file in enumerate(sorted(os.listdir(ann_dir))):
 
103
  tokens = []
104
  bboxes = []
105
  ner_tags = []
@@ -118,4 +119,4 @@ class SLR(datasets.GeneratorBasedBuilder):
118
  bbox=item['bbox']
119
  bboxes.append(bbox)
120
 
121
- yield guid, {"id": str(guid), "tokens": tokens, "bboxes": bboxes, "ner_tags": ner_tags, "image": image, "image_path": image_path}
 
100
  ann_dir = os.path.join(filepath, "annotations")
101
  img_dir = os.path.join(filepath, "images")
102
  for guid, file in enumerate(sorted(os.listdir(ann_dir))):
103
+ words=[]
104
  tokens = []
105
  bboxes = []
106
  ner_tags = []
 
119
  bbox=item['bbox']
120
  bboxes.append(bbox)
121
 
122
+ yield guid, {"id": str(guid),"words":words, "tokens": tokens, "bboxes": bboxes, "ner_tags": ner_tags, "image": image, "image_path": image_path}