- LongConL.py +24 -20
LongConL.py
CHANGED
|
@@ -61,26 +61,30 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
|
|
| 61 |
license=_LICENSE,
|
| 62 |
)
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
def _generate_examples(self, file_path):
|
| 86 |
"""Generate examples from the dataset CSV."""
|
|
|
|
| 61 |
license=_LICENSE,
|
| 62 |
)
|
| 63 |
|
| 64 |
+
def _split_generators(self, dl_manager):
|
| 65 |
+
"""Split the dataset into train, validation, and test."""
|
| 66 |
+
task_name = self.config.name # Get the current task name from the config
|
| 67 |
+
valid_task_name = task_name.replace("-", "_") # Replace hyphens with underscores
|
| 68 |
+
|
| 69 |
+
# Update URLs with the valid task name
|
| 70 |
+
urls = {key: val.format(task_name=valid_task_name) for key, val in _URLS.items()}
|
| 71 |
+
downloaded_files = dl_manager.download_and_extract(urls)
|
| 72 |
+
|
| 73 |
+
return [
|
| 74 |
+
datasets.SplitGenerator(
|
| 75 |
+
name=datasets.Split.TRAIN,
|
| 76 |
+
gen_kwargs={"file_path": downloaded_files["train"]},
|
| 77 |
+
),
|
| 78 |
+
datasets.SplitGenerator(
|
| 79 |
+
name=datasets.Split.VALIDATION,
|
| 80 |
+
gen_kwargs={"file_path": downloaded_files["validation"]},
|
| 81 |
+
),
|
| 82 |
+
datasets.SplitGenerator(
|
| 83 |
+
name=datasets.Split.TEST,
|
| 84 |
+
gen_kwargs={"file_path": downloaded_files["test"]},
|
| 85 |
+
),
|
| 86 |
+
]
|
| 87 |
+
|
| 88 |
|
| 89 |
def _generate_examples(self, file_path):
|
| 90 |
"""Generate examples from the dataset CSV."""
|