Datasets:

Modalities:
Text
Languages:
Icelandic
Libraries:
Datasets
License:
vesteinn commited on
Commit
13b27e5
·
1 Parent(s): 7d8f434

Corrected category lookup

Browse files
Files changed (1) hide show
  1. icelandic-error-corpus-IceEC.py +3 -1
icelandic-error-corpus-IceEC.py CHANGED
@@ -841,6 +841,8 @@ class IceEC(datasets.GeneratorBasedBuilder):
841
  for line in f:
842
  data = json.loads(line.strip())
843
  if self.config.level is not None:
844
- errors = [ERROR_INFORMATION[e][self.config.level] for e in data["errors"]]
 
 
845
  data["errors"] = errors
846
  yield data["idx"], data
 
841
  for line in f:
842
  data = json.loads(line.strip())
843
  if self.config.level is not None:
844
+ errors = []
845
+ for word_errors in data["errors"]:
846
+ errors.append([ERROR_INFORMATION[e][self.config.level] for e in word_errors])
847
  data["errors"] = errors
848
  yield data["idx"], data