Upload wikipedia_tw.py
Browse files- wikipedia_tw.py +4 -4
wikipedia_tw.py
CHANGED
@@ -89,11 +89,11 @@ class Wikipedia_tw(datasets.GeneratorBasedBuilder):
|
|
89 |
key = 0
|
90 |
with open(filepath, 'r', encoding='UTF-8') as f:
|
91 |
wikipedia = json.load(f, strict=False,)
|
92 |
-
for
|
93 |
-
title =
|
94 |
-
article =
|
95 |
yield key, {
|
96 |
"title": title,
|
97 |
"article": article,
|
98 |
}
|
99 |
-
|
|
|
89 |
key = 0
|
90 |
with open(filepath, 'r', encoding='UTF-8') as f:
|
91 |
wikipedia = json.load(f, strict=False,)
|
92 |
+
for page_index in len(wikipedia):
|
93 |
+
title = wikipedia[page_index]["title"]
|
94 |
+
article = wikipedia[page_index]["article"]
|
95 |
yield key, {
|
96 |
"title": title,
|
97 |
"article": article,
|
98 |
}
|
99 |
+
key=key+1
|