Initial Commit
Browse files- split-test.py +4 -1
split-test.py
CHANGED
@@ -128,7 +128,7 @@ class SplitTest(datasets.GeneratorBasedBuilder):
|
|
128 |
|
129 |
data_dir = "https://huggingface.co/datasets/shivam/split-test/blob/main/text." + _LANGS[self.config.name]
|
130 |
archive_path = dl_manager.download(data_dir)
|
131 |
-
|
132 |
return [
|
133 |
datasets.SplitGenerator(
|
134 |
name=datasets.Split.TRAIN,
|
@@ -144,6 +144,9 @@ class SplitTest(datasets.GeneratorBasedBuilder):
|
|
144 |
def _generate_examples(self, filepath, split):
|
145 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
146 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
|
|
|
|
|
|
147 |
with open(filepath, encoding="utf-8") as f:
|
148 |
for key, row in enumerate(f):
|
149 |
data = json.loads(row)
|
|
|
128 |
|
129 |
data_dir = "https://huggingface.co/datasets/shivam/split-test/blob/main/text." + _LANGS[self.config.name]
|
130 |
archive_path = dl_manager.download(data_dir)
|
131 |
+
|
132 |
return [
|
133 |
datasets.SplitGenerator(
|
134 |
name=datasets.Split.TRAIN,
|
|
|
144 |
def _generate_examples(self, filepath, split):
|
145 |
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
146 |
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
147 |
+
|
148 |
+
file_path = os.path.join(data_dir, "text." + _LANGS[self.config.name])
|
149 |
+
|
150 |
with open(filepath, encoding="utf-8") as f:
|
151 |
for key, row in enumerate(f):
|
152 |
data = json.loads(row)
|