Update funsd-iob-original.py
Browse files- funsd-iob-original.py +3 -2
funsd-iob-original.py
CHANGED
@@ -118,10 +118,11 @@ class Funsd(datasets.GeneratorBasedBuilder):
|
|
118 |
else:
|
119 |
words.append(words_example[0]["text"])
|
120 |
ner_tags.append("B-" + label.upper())
|
121 |
-
|
|
|
122 |
for w in words_example[1:]:
|
123 |
words.append(w["text"])
|
124 |
ner_tags.append("I-" + label.upper())
|
125 |
bboxes.append(normalize_bbox(w["box"], size))
|
126 |
original_bboxes.append(w["box"])
|
127 |
-
yield guid, {"id": str(guid), "words": words, "
|
|
|
118 |
else:
|
119 |
words.append(words_example[0]["text"])
|
120 |
ner_tags.append("B-" + label.upper())
|
121 |
+
bboxes.append(words_example[0]["box"])
|
122 |
+
original_bboxes.append(words_example[0]["box"]])
|
123 |
for w in words_example[1:]:
|
124 |
words.append(w["text"])
|
125 |
ner_tags.append("I-" + label.upper())
|
126 |
bboxes.append(normalize_bbox(w["box"], size))
|
127 |
original_bboxes.append(w["box"])
|
128 |
+
yield guid, {"id": str(guid), "words": words, "bboxes": bboxes, "original_bboxes": original_bboxes, "ner_tags": ner_tags, "image": image}
|