Update dummy-text.py
Browse files- dummy-text.py +6 -10
dummy-text.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
# coding=utf-8
|
3 |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
4 |
#
|
@@ -67,15 +66,12 @@ class Openwebtext(datasets.GeneratorBasedBuilder):
|
|
67 |
def _generate_examples(self, archive_iterators, iter_archive):
|
68 |
"""Yields examples."""
|
69 |
for archive_iterator in archive_iterators:
|
70 |
-
for
|
71 |
-
print(">>>>>",
|
72 |
# if not xz_filepath.endswith(".xz"):
|
73 |
# continue
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
idx = f"{xz_filepath}/{txt_filepath}"
|
79 |
-
print("id = ", id)
|
80 |
-
yield idx, {"text": re.sub("\n\n\n+", "\n\n", txt_f.read().decode("utf-8")).strip()}
|
81 |
|
|
|
|
|
1 |
# coding=utf-8
|
2 |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
#
|
|
|
66 |
def _generate_examples(self, archive_iterators, iter_archive):
|
67 |
"""Yields examples."""
|
68 |
for archive_iterator in archive_iterators:
|
69 |
+
for text_filepath, text_f in archive_iterator:
|
70 |
+
print(">>>>>", text_filepath)
|
71 |
# if not xz_filepath.endswith(".xz"):
|
72 |
# continue
|
73 |
+
idx = f"{text_filepath}"
|
74 |
+
print("id = ", id)
|
75 |
+
yield idx, {"text": re.sub("\n\n\n+", "\n\n", text_f.read().decode("utf-8")).strip()}
|
76 |
+
|
|
|
|
|
|
|
77 |
|