Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
SamAdamDay commited on
Commit
9bac24d
1 Parent(s): 59bdbc7

Update wiki_toxic.py

Browse files
Files changed (1) hide show
  1. wiki_toxic.py +5 -5
wiki_toxic.py CHANGED
@@ -77,13 +77,13 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
77
  )
78
 
79
  def _split_generators(self, dl_manager):
80
- data_dir = dl_manager.download_and_extract(_URLS)
81
  return [
82
  datasets.SplitGenerator(
83
  name=datasets.Split.TRAIN,
84
  # These kwargs will be passed to _generate_examples
85
  gen_kwargs={
86
- "filepath": os.path.join(data_dir, "train.csv"),
87
  "split": "train",
88
  },
89
  ),
@@ -91,7 +91,7 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
91
  name=datasets.Split.VALIDATION,
92
  # These kwargs will be passed to _generate_examples
93
  gen_kwargs={
94
- "filepath": os.path.join(data_dir, "validation.csv"),
95
  "split": "validation",
96
  },
97
  ),
@@ -99,7 +99,7 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
99
  name=datasets.Split.TEST,
100
  # These kwargs will be passed to _generate_examples
101
  gen_kwargs={
102
- "filepath": os.path.join(data_dir, "test.csv"),
103
  "split": "test"
104
  },
105
  ),
@@ -107,7 +107,7 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
107
  name="balanced_train",
108
  # These kwargs will be passed to _generate_examples
109
  gen_kwargs={
110
- "filepath": os.path.join(data_dir, "balanced_train.csv"),
111
  "split": "balanced_train"
112
  },
113
  ),
 
77
  )
78
 
79
  def _split_generators(self, dl_manager):
80
+ downloaded_files = dl_manager.download_and_extract(_URLS)
81
  return [
82
  datasets.SplitGenerator(
83
  name=datasets.Split.TRAIN,
84
  # These kwargs will be passed to _generate_examples
85
  gen_kwargs={
86
+ "filepath": downloaded_files["train"],
87
  "split": "train",
88
  },
89
  ),
 
91
  name=datasets.Split.VALIDATION,
92
  # These kwargs will be passed to _generate_examples
93
  gen_kwargs={
94
+ "filepath": downloaded_files["validation"],
95
  "split": "validation",
96
  },
97
  ),
 
99
  name=datasets.Split.TEST,
100
  # These kwargs will be passed to _generate_examples
101
  gen_kwargs={
102
+ "filepath": downloaded_files["test"],
103
  "split": "test"
104
  },
105
  ),
 
107
  name="balanced_train",
108
  # These kwargs will be passed to _generate_examples
109
  gen_kwargs={
110
+ "filepath": downloaded_files["balanced_train"],
111
  "split": "balanced_train"
112
  },
113
  ),