martingrzzler commited on
Commit
48949cc
1 Parent(s): 40ff3c0

Update kanjis2radicals.py

Browse files
Files changed (1) hide show
  1. kanjis2radicals.py +4 -3
kanjis2radicals.py CHANGED
@@ -55,16 +55,17 @@ class Kanji2Radicals(datasets.GeneratorBasedBuilder):
55
  def _generate_examples(self, metadata_path, images_iter):
56
  radicals = []
57
 
58
- print(next(iter(os.listdir(images_iter))))
59
- print('hi there')
60
-
61
  with open(metadata_path, encoding="utf-8") as f:
62
  for line in f:
63
  metadata = json.loads(line)
64
  radicals.append(metadata)
65
 
66
  for idx, (image_path, image) in enumerate(images_iter):
 
 
67
  yield image_path, {
68
  "radicals": radicals[idx],
69
  "kanji_image": image.read(),
70
  }
 
 
 
55
  def _generate_examples(self, metadata_path, images_iter):
56
  radicals = []
57
 
 
 
 
58
  with open(metadata_path, encoding="utf-8") as f:
59
  for line in f:
60
  metadata = json.loads(line)
61
  radicals.append(metadata)
62
 
63
  for idx, (image_path, image) in enumerate(images_iter):
64
+ print(f"Processing image {idx}...")
65
+ print(image_path)
66
  yield image_path, {
67
  "radicals": radicals[idx],
68
  "kanji_image": image.read(),
69
  }
70
+
71
+