Felix commited on
Commit
a01bec3
1 Parent(s): e6f8644

rename dalaj -> dalaj-ged

Browse files
Files changed (1) hide show
  1. superlim-2.py +12 -23
superlim-2.py CHANGED
@@ -112,7 +112,7 @@ _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",
117
  "swesim_similarity": "supersim-superlim/supersim-superlim-similarity",
118
  "sweana": "sweanalogy",
@@ -161,7 +161,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
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),
167
  datasets.BuilderConfig(name="sweana", version=VERSION, description=_SweAna_DESCRIPTION),
@@ -175,18 +175,12 @@ class SuperLim(datasets.GeneratorBasedBuilder):
175
 
176
  def _info(self):
177
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
178
- if self.config.name == "dalaj": # This is the name of the configuration selected in BUILDER_CONFIGS above
179
  features = datasets.Features(
180
  {
181
- "original_sentence": datasets.Value("string"),
182
- "corrected_sentence": datasets.Value("string"),
183
- "error_indices": datasets.Value("string"),
184
- "corrected_indices": datasets.Value("string"),
185
- "error_corr_pair": datasets.Value("string"),
186
- "error_label": datasets.Value("string"),
187
- "l1": datasets.Value("string"),
188
- "approximate_level": datasets.Value("string"),
189
- # These are the features of your dataset like images, labels ...
190
  }
191
  )
192
  elif self.config.name == 'absabank-imm':
@@ -338,7 +332,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
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,7 +343,7 @@ class SuperLim(datasets.GeneratorBasedBuilder):
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,
@@ -367,17 +361,12 @@ class SuperLim(datasets.GeneratorBasedBuilder):
367
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
368
  df = pd.read_json(filepath, lines=True)
369
  for key, row in df.iterrows():
370
- if self.config.name == "dalaj":
371
  # Yields examples as (key, example) tuples
372
  yield key, {
373
- "original_sentence": row["original sentence"],
374
- "corrected_sentence": row["corrected sentence"],
375
- "error_indices": row["error indices"],
376
- "corrected_indices": row["corrected indices"],
377
- "error_corr_pair": row["error-corr pair"],
378
- "error_label": row["error label"],
379
- "l1": row["l1"],
380
- "approximate_level": row["approximate level"],
381
  }
382
  elif self.config.name == "absabank-imm":
383
  yield key, {
 
112
  _TASKS = {
113
  "absabank-imm": "absabank-imm",
114
  "argumentation_sent":"argumentation-sentences",
115
+ "dalaj-ged": "dalag-ged-superlim",
116
  "swesim_relatedness": "supersim-superlim/supersim-superlim-relatedness",
117
  "swesim_similarity": "supersim-superlim/supersim-superlim-similarity",
118
  "sweana": "sweanalogy",
 
161
 
162
  BUILDER_CONFIGS = [
163
  datasets.BuilderConfig(name="absabank-imm", version=VERSION, description=_DaLAJ_DESCRIPTION),
164
+ datasets.BuilderConfig(name="dalaj-ged", 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),
167
  datasets.BuilderConfig(name="sweana", version=VERSION, description=_SweAna_DESCRIPTION),
 
175
 
176
  def _info(self):
177
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
178
+ if self.config.name == "dalaj-ged": # This is the name of the configuration selected in BUILDER_CONFIGS above
179
  features = datasets.Features(
180
  {
181
+ "sentence": datasets.Value("string"),
182
+ "label": datasets.Value("string"),
183
+ "meta": datasets.Value("string")
 
 
 
 
 
 
184
  }
185
  )
186
  elif self.config.name == 'absabank-imm':
 
332
  },
333
  )
334
  splits.append(split_test)
335
+ if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "swedn"):
336
  data_dir_dev = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_dev.{file_format}"))
337
  split_dev = datasets.SplitGenerator(
338
  name=datasets.Split.VALIDATION,
 
343
  },
344
  )
345
  splits.append(split_dev)
346
+ if self.config.name in ("absabank-imm", "dalaj-ged", "swefaq", "swewic", "argumentation_sent", "swedn"):
347
  data_dir_train = dl_manager.download_and_extract(os.path.join(_URL,_TASKS[self.config.name],f"{_TASKS[self.config.name]}_train.{file_format}"))
348
  split_train = datasets.SplitGenerator(
349
  name=datasets.Split.TRAIN,
 
361
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
362
  df = pd.read_json(filepath, lines=True)
363
  for key, row in df.iterrows():
364
+ if self.config.name == "dalaj-ged":
365
  # Yields examples as (key, example) tuples
366
  yield key, {
367
+ "sentence": row["sentence"],
368
+ "label": row["label"],
369
+ "meta": row["meta"],
 
 
 
 
 
370
  }
371
  elif self.config.name == "absabank-imm":
372
  yield key, {