Felix commited on
Commit
89e09da
·
1 Parent(s): 6207f8f

change csv to tsv and add exception jsonl exception for SweWic

Browse files
Files changed (1) hide show
  1. superlim-2.py +5 -4
superlim-2.py CHANGED
@@ -274,9 +274,10 @@ class SuperLim(datasets.GeneratorBasedBuilder):
274
 
275
  def _split_generators(self, dl_manager):
276
  if self.config.name in ("absabank", "dalaj", "swefaq", "swewic"):
277
- data_dir_test = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],"test.csv"))
278
- data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],"train.csv"))
279
- data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],"dev.csv"))
 
280
 
281
  return [
282
  datasets.SplitGenerator(
@@ -305,7 +306,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
305
  ),
306
  ]
307
  else:
308
- data_dir_test = dl_manager.download_and_extract(os.path.join(_URL, _TASKS[self.config.name], "test.csv"))
309
  return [
310
  datasets.SplitGenerator(
311
  name=datasets.Split.TEST,
 
274
 
275
  def _split_generators(self, dl_manager):
276
  if self.config.name in ("absabank", "dalaj", "swefaq", "swewic"):
277
+ file_format = 'tsv' if self.config.name != 'swewic' else 'jsonl'
278
+ data_dir_test = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"test.{file_format}"))
279
+ data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"train.{file_format}"))
280
+ data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"dev.{file_format}"))
281
 
282
  return [
283
  datasets.SplitGenerator(
 
306
  ),
307
  ]
308
  else:
309
+ data_dir_test = dl_manager.download_and_extract(os.path.join(_URL, _TASKS[self.config.name], "test.tsv"))
310
  return [
311
  datasets.SplitGenerator(
312
  name=datasets.Split.TEST,