cooleel commited on
Commit
be0d512
1 Parent(s): 1d2cc51

Update xfund_de.py

Browse files
Files changed (1) hide show
  1. xfund_de.py +3 -3
xfund_de.py CHANGED
@@ -151,8 +151,8 @@ class XFund(datasets.GeneratorBasedBuilder):
151
  else:
152
  label_list = [f'B-{item["label"].upper()}'] + ['I-' + item['label'].upper()] * (len(item['words']) - 1)
153
 
154
- tokens.append(word_text_list)
155
- bboxes.append(word_box_list)
156
- tags.append(label_list)
157
 
158
  yield guid, {"id": doc["id"], "tokens": tokens, "bboxes": bboxes, "tags": tags, "image": Image.open(image_file)}
 
151
  else:
152
  label_list = [f'B-{item["label"].upper()}'] + ['I-' + item['label'].upper()] * (len(item['words']) - 1)
153
 
154
+ tokens.extend(word_text_list)
155
+ bboxes.extend(word_box_list)
156
+ tags.extend(label_list)
157
 
158
  yield guid, {"id": doc["id"], "tokens": tokens, "bboxes": bboxes, "tags": tags, "image": Image.open(image_file)}