Felix commited on
Commit
e448142
1 Parent(s): b0d9e5e

add dummy None values when meta.error_span and meta.confusion_pair values are missing in dalaj

Browse files
Files changed (1) hide show
  1. superlim-2.py +8 -1
superlim-2.py CHANGED
@@ -448,10 +448,17 @@ class SuperLim(datasets.GeneratorBasedBuilder):
448
  }
449
  elif self.config.name == "dalaj-ged":
450
  # Yields examples as (key, example) tuples
 
 
 
 
 
 
 
451
  yield key, {
452
  "sentence": row["sentence"],
453
  "label": row["label"],
454
- "meta": row["meta"],
455
  }
456
  elif self.config.name == "sweana":
457
  yield key, {
 
448
  }
449
  elif self.config.name == "dalaj-ged":
450
  # Yields examples as (key, example) tuples
451
+ meta = row['meta']
452
+ # Add None values when error span and confusion_pair values are missing.
453
+ if not meta['error_span'] and not meta['confusion_pair']:
454
+ meta['error_span']['start'] = None
455
+ meta['error_span']['stop'] = None
456
+ meta['confusion_pair']['incorrect_span'] = None
457
+ meta['confusion_pair']['correction'] = None
458
  yield key, {
459
  "sentence": row["sentence"],
460
  "label": row["label"],
461
+ "meta": meta,
462
  }
463
  elif self.config.name == "sweana":
464
  yield key, {