nielsr HF staff commited on
Commit
6a9c23e
1 Parent(s): 1e88eb6

Update funsd-iob-original.py

Browse files
Files changed (1) hide show
  1. 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
- boxes.append(words_example[0]["box"])
 
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, "boxes": boxes, "original_bboxes": original_bboxes, "ner_tags": ner_tags, "image": image}
 
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}