Datasets:

Modalities:
Tabular
Text
ArXiv:
Libraries:
Datasets
License:
Jonathan Li commited on
Commit
927a07e
1 Parent(s): 32ca3ad
Files changed (1) hide show
  1. echr.py +5 -4
echr.py CHANGED
@@ -110,13 +110,14 @@ class Echr(datasets.GeneratorBasedBuilder):
110
  )
111
 
112
  def _split_generators(self, dl_manager):
113
- data_dir = os.path.join(dl_manager._base_path, self.config.data_dir)
 
114
  return [
115
  datasets.SplitGenerator(
116
  name=datasets.Split.TRAIN,
117
  # These kwargs will be passed to _generate_examples
118
  gen_kwargs={
119
- "filepath": os.path.join(data_dir, "train.jsonl"),
120
  "split": "train",
121
  },
122
  ),
@@ -124,7 +125,7 @@ class Echr(datasets.GeneratorBasedBuilder):
124
  name=datasets.Split.TEST,
125
  # These kwargs will be passed to _generate_examples
126
  gen_kwargs={
127
- "filepath": os.path.join(data_dir, "test.jsonl"),
128
  "split": "test",
129
  },
130
  ),
@@ -132,7 +133,7 @@ class Echr(datasets.GeneratorBasedBuilder):
132
  name=datasets.Split.VALIDATION,
133
  # These kwargs will be passed to _generate_examples
134
  gen_kwargs={
135
- "filepath": os.path.join(data_dir, "dev.jsonl"),
136
  "split": "dev",
137
  },
138
  ),
 
110
  )
111
 
112
  def _split_generators(self, dl_manager):
113
+ path_prefix = self.config.data_dir
114
+ data_dir = dl_manager.download([os.path.join(path_prefix, f"{f}.jsonl") for f in ["train", "test", "dev"]])
115
  return [
116
  datasets.SplitGenerator(
117
  name=datasets.Split.TRAIN,
118
  # These kwargs will be passed to _generate_examples
119
  gen_kwargs={
120
+ "filepath": data_dir[0],
121
  "split": "train",
122
  },
123
  ),
 
125
  name=datasets.Split.TEST,
126
  # These kwargs will be passed to _generate_examples
127
  gen_kwargs={
128
+ "filepath": data_dir[1],
129
  "split": "test",
130
  },
131
  ),
 
133
  name=datasets.Split.VALIDATION,
134
  # These kwargs will be passed to _generate_examples
135
  gen_kwargs={
136
+ "filepath": data_dir[2],
137
  "split": "dev",
138
  },
139
  ),