Datasets:
Commit
·
94c002a
1
Parent(s):
e2f4cd3
Update naab.py
Browse files
naab.py
CHANGED
|
@@ -104,42 +104,21 @@ class Naab(datasets.GeneratorBasedBuilder):
|
|
| 104 |
datasets.SplitGenerator(
|
| 105 |
name=datasets.Split.TRAIN,
|
| 106 |
gen_kwargs={
|
| 107 |
-
"
|
| 108 |
"split": "train"
|
| 109 |
}
|
| 110 |
),
|
| 111 |
datasets.SplitGenerator(
|
| 112 |
name=datasets.Split.TEST,
|
| 113 |
gen_kwargs={
|
| 114 |
-
"
|
| 115 |
"split": "test"
|
| 116 |
}
|
| 117 |
),
|
| 118 |
]
|
| 119 |
-
|
| 120 |
-
#urls = _URLS[self.config.name]
|
| 121 |
-
#data_dir = dl_manager.download_and_extract(urls)
|
| 122 |
-
#return [
|
| 123 |
-
# datasets.SplitGenerator(
|
| 124 |
-
# name=datasets.Split.TRAIN,
|
| 125 |
-
# These kwargs will be passed to _generate_examples
|
| 126 |
-
# gen_kwargs={
|
| 127 |
-
# "filepath": os.path.join(data_dir, "train.txt"),
|
| 128 |
-
# "split": "train",
|
| 129 |
-
# },
|
| 130 |
-
# ),
|
| 131 |
-
# datasets.SplitGenerator(
|
| 132 |
-
# name=datasets.Split.TEST,
|
| 133 |
-
# # These kwargs will be passed to _generate_examples
|
| 134 |
-
# gen_kwargs={
|
| 135 |
-
# "filepath": os.path.join(data_dir, "test.txt"),
|
| 136 |
-
# "split": "test"
|
| 137 |
-
# },
|
| 138 |
-
# ),
|
| 139 |
-
#]
|
| 140 |
|
| 141 |
def _generate_examples(self, filepath, split):
|
| 142 |
-
|
| 143 |
with open(filepath, encoding="utf-8") as f:
|
| 144 |
for key, row in enumerate(f):
|
| 145 |
if row.strip():
|
|
|
|
| 104 |
datasets.SplitGenerator(
|
| 105 |
name=datasets.Split.TRAIN,
|
| 106 |
gen_kwargs={
|
| 107 |
+
"filepath": train_downloaded_files,
|
| 108 |
"split": "train"
|
| 109 |
}
|
| 110 |
),
|
| 111 |
datasets.SplitGenerator(
|
| 112 |
name=datasets.Split.TEST,
|
| 113 |
gen_kwargs={
|
| 114 |
+
"filepath": test_downloaded_files,
|
| 115 |
"split": "test"
|
| 116 |
}
|
| 117 |
),
|
| 118 |
]
|
| 119 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
def _generate_examples(self, filepath, split):
|
|
|
|
| 122 |
with open(filepath, encoding="utf-8") as f:
|
| 123 |
for key, row in enumerate(f):
|
| 124 |
if row.strip():
|