Datasets:

srzhang commited on
Commit
6da7319
·
1 Parent(s): c55975e
Files changed (1) hide show
  1. LongConL.py +24 -20
LongConL.py CHANGED
@@ -61,26 +61,30 @@ class LongConLDataset(datasets.GeneratorBasedBuilder):
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
- urls = {key: val.format(task_name=task_name) for key, val in _URLS.items()} # Update URLs with the task name
68
- downloaded_files = dl_manager.download_and_extract(urls)
69
-
70
- return [
71
- datasets.SplitGenerator(
72
- name=datasets.Split.TRAIN,
73
- gen_kwargs={"file_path": downloaded_files["train"]},
74
- ),
75
- datasets.SplitGenerator(
76
- name=datasets.Split.VALIDATION,
77
- gen_kwargs={"file_path": downloaded_files["validation"]},
78
- ),
79
- datasets.SplitGenerator(
80
- name=datasets.Split.TEST,
81
- gen_kwargs={"file_path": downloaded_files["test"]},
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."""