Datasets:
SLPL
/

Modalities:
Text
Languages:
Persian
ArXiv:
Libraries:
Datasets
License:
sadrasabouri commited on
Commit
e2f4cd3
1 Parent(s): 839d178

Update naab.py

Browse files
Files changed (1) hide show
  1. naab.py +32 -9
naab.py CHANGED
@@ -94,26 +94,49 @@ class Naab(datasets.GeneratorBasedBuilder):
94
  )
95
 
96
  def _split_generators(self, dl_manager):
97
- urls = _URLS[self.config.name]
98
- data_dir = dl_manager.download_and_extract(urls)
 
 
 
 
99
  return [
100
  datasets.SplitGenerator(
101
  name=datasets.Split.TRAIN,
102
- # These kwargs will be passed to _generate_examples
103
  gen_kwargs={
104
- "filepath": os.path.join(data_dir, "train.txt"),
105
- "split": "train",
106
- },
107
  ),
108
  datasets.SplitGenerator(
109
  name=datasets.Split.TEST,
110
- # These kwargs will be passed to _generate_examples
111
  gen_kwargs={
112
- "filepath": os.path.join(data_dir, "test.txt"),
113
  "split": "test"
114
- },
115
  ),
116
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
  def _generate_examples(self, filepath, split):
119
 
 
94
  )
95
 
96
  def _split_generators(self, dl_manager):
97
+ data_urls = {}
98
+ for split in ["train", "test"]:
99
+ data_urls[split] = _URLS[split]
100
+
101
+ train_downloaded_files = dl_manager.download(data_urls["train"])
102
+ test_downloaded_files = dl_manager.download(data_urls["test"])
103
  return [
104
  datasets.SplitGenerator(
105
  name=datasets.Split.TRAIN,
 
106
  gen_kwargs={
107
+ "filepaths": train_downloaded_files,
108
+ "split": "train"
109
+ }
110
  ),
111
  datasets.SplitGenerator(
112
  name=datasets.Split.TEST,
 
113
  gen_kwargs={
114
+ "filepaths": test_downloaded_files,
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