Felix commited on
Commit
e6f8644
1 Parent(s): 15f54c7

refactor absabank files and config name -> absabank-imm

Browse files
data/absabank-imm/{ABSAbank-Imm_dev.jsonl → absabank-imm_dev.jsonl} RENAMED
File without changes
data/absabank-imm/{ABSAbank-Imm_test.jsonl → absabank-imm_test.jsonl} RENAMED
File without changes
data/absabank-imm/{ABSAbank-Imm_train.jsonl → absabank-imm_train.jsonl} RENAMED
File without changes
superlim-2.py CHANGED
@@ -110,7 +110,7 @@ _argumentation_sentences_DESCRIPTION_CITATION = """\
110
  # TODO: Add link to the official GitHub repo once it becomes public
111
  _URL = "https://huggingface.co/datasets/sbx/superlim-2/resolve/main/data/"
112
  _TASKS = {
113
- "absabank": "absabank-imm",
114
  "argumentation_sent":"argumentation-sentences",
115
  "dalaj": "dalag-ged-superlim",
116
  "swesim_relatedness": "supersim-superlim/supersim-superlim-relatedness",
@@ -160,7 +160,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
160
  VERSION = datasets.Version("2.0.0")
161
 
162
  BUILDER_CONFIGS = [
163
- datasets.BuilderConfig(name="absabank", version=VERSION, description=_DaLAJ_DESCRIPTION),
164
  datasets.BuilderConfig(name="dalaj", version=VERSION, description=_DaLAJ_DESCRIPTION),
165
  datasets.BuilderConfig(name="swesim_relatedness", version=VERSION, description=_SweSim_DESCRIPTION),
166
  datasets.BuilderConfig(name="swesim_similarity", version=VERSION, description=_SweSim_DESCRIPTION),
@@ -189,9 +189,10 @@ class SuperLim(datasets.GeneratorBasedBuilder):
189
  # These are the features of your dataset like images, labels ...
190
  }
191
  )
192
- elif self.config.name == 'absabank':
193
  features = datasets.Features(
194
  {
 
195
  "text": datasets.Value("string"),
196
  "label": datasets.Value(dtype='float32')
197
  }
@@ -337,7 +338,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
337
  },
338
  )
339
  splits.append(split_test)
340
- if self.config.name in ("absabank", "dalaj", "swefaq", "swewic", "swedn"):
341
  data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_dev.{file_format}"))
342
  split_dev = datasets.SplitGenerator(
343
  name=datasets.Split.VALIDATION,
@@ -348,7 +349,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
348
  },
349
  )
350
  splits.append(split_dev)
351
- if self.config.name in ("absabank", "dalaj", "swefaq", "swewic", "argumentation_sent", "swedn"):
352
  data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_train.{file_format}"))
353
  split_train = datasets.SplitGenerator(
354
  name=datasets.Split.TRAIN,
@@ -378,8 +379,9 @@ class SuperLim(datasets.GeneratorBasedBuilder):
378
  "l1": row["l1"],
379
  "approximate_level": row["approximate level"],
380
  }
381
- elif self.config.name == "absabank":
382
  yield key, {
 
383
  "text": row["text"],
384
  "label": row["label"],
385
  }
 
110
  # TODO: Add link to the official GitHub repo once it becomes public
111
  _URL = "https://huggingface.co/datasets/sbx/superlim-2/resolve/main/data/"
112
  _TASKS = {
113
+ "absabank-imm": "absabank-imm",
114
  "argumentation_sent":"argumentation-sentences",
115
  "dalaj": "dalag-ged-superlim",
116
  "swesim_relatedness": "supersim-superlim/supersim-superlim-relatedness",
 
160
  VERSION = datasets.Version("2.0.0")
161
 
162
  BUILDER_CONFIGS = [
163
+ datasets.BuilderConfig(name="absabank-imm", version=VERSION, description=_DaLAJ_DESCRIPTION),
164
  datasets.BuilderConfig(name="dalaj", version=VERSION, description=_DaLAJ_DESCRIPTION),
165
  datasets.BuilderConfig(name="swesim_relatedness", version=VERSION, description=_SweSim_DESCRIPTION),
166
  datasets.BuilderConfig(name="swesim_similarity", version=VERSION, description=_SweSim_DESCRIPTION),
 
189
  # These are the features of your dataset like images, labels ...
190
  }
191
  )
192
+ elif self.config.name == 'absabank-imm':
193
  features = datasets.Features(
194
  {
195
+ "id": datasets.Value("string"),
196
  "text": datasets.Value("string"),
197
  "label": datasets.Value(dtype='float32')
198
  }
 
338
  },
339
  )
340
  splits.append(split_test)
341
+ if self.config.name in ("absabank-imm", "dalaj", "swefaq", "swewic", "swedn"):
342
  data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_dev.{file_format}"))
343
  split_dev = datasets.SplitGenerator(
344
  name=datasets.Split.VALIDATION,
 
349
  },
350
  )
351
  splits.append(split_dev)
352
+ if self.config.name in ("absabank-imm", "dalaj", "swefaq", "swewic", "argumentation_sent", "swedn"):
353
  data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_train.{file_format}"))
354
  split_train = datasets.SplitGenerator(
355
  name=datasets.Split.TRAIN,
 
379
  "l1": row["l1"],
380
  "approximate_level": row["approximate level"],
381
  }
382
+ elif self.config.name == "absabank-imm":
383
  yield key, {
384
+ "id": row['id'],
385
  "text": row["text"],
386
  "label": row["label"],
387
  }