martingrzzler
commited on
Commit
•
5c03281
1
Parent(s):
14f4e67
Update kanjis2radicals.py
Browse files- kanjis2radicals.py +4 -4
kanjis2radicals.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import datasets
|
|
|
2 |
import json
|
3 |
|
4 |
_DESCRIPTION = """\
|
@@ -53,9 +54,9 @@ class Kanji2Radicals(datasets.GeneratorBasedBuilder):
|
|
53 |
|
54 |
def _generate_examples(self, metadata_path, images_iter):
|
55 |
radicals = []
|
56 |
-
|
57 |
-
print(images_iter)
|
58 |
-
|
59 |
with open(metadata_path, encoding="utf-8") as f:
|
60 |
for line in f:
|
61 |
metadata = json.loads(line)
|
@@ -66,4 +67,3 @@ class Kanji2Radicals(datasets.GeneratorBasedBuilder):
|
|
66 |
"radicals": radicals[idx],
|
67 |
"kanji_image": image.read(),
|
68 |
}
|
69 |
-
|
|
|
1 |
import datasets
|
2 |
+
import os
|
3 |
import json
|
4 |
|
5 |
_DESCRIPTION = """\
|
|
|
54 |
|
55 |
def _generate_examples(self, metadata_path, images_iter):
|
56 |
radicals = []
|
57 |
+
|
58 |
+
print(os.listdir(images_iter))
|
59 |
+
|
60 |
with open(metadata_path, encoding="utf-8") as f:
|
61 |
for line in f:
|
62 |
metadata = json.loads(line)
|
|
|
67 |
"radicals": radicals[idx],
|
68 |
"kanji_image": image.read(),
|
69 |
}
|
|