Update xfund_de.py
Browse files- 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.
|
155 |
-
bboxes.
|
156 |
-
tags.
|
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)}
|