rominaoji commited on
Commit
1bc0874
1 Parent(s): b8c3071

Upload MIM-GOLD-NER.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. MIM-GOLD-NER.py +6 -1
MIM-GOLD-NER.py CHANGED
@@ -149,7 +149,11 @@ class MIMGoldNER(datasets.GeneratorBasedBuilder):
149
  logger.warning(f"Skipping line in {filepath}: {line.strip()}")
150
  continue
151
  tokens.append(splits)
152
- ner_tags.append(splits.rstrip())
 
 
 
 
153
  # last example
154
  if tokens:
155
  yield guid, {
@@ -158,3 +162,4 @@ class MIMGoldNER(datasets.GeneratorBasedBuilder):
158
  "ner_tags": ner_tags,
159
  }
160
 
 
 
149
  logger.warning(f"Skipping line in {filepath}: {line.strip()}")
150
  continue
151
  tokens.append(splits)
152
+ try:
153
+ ner_tags.append(splits.rstrip())
154
+ except IndexError:
155
+ logger.error(f"Error processing line in {filepath}: {line.strip()}")
156
+ raise
157
  # last example
158
  if tokens:
159
  yield guid, {
 
162
  "ner_tags": ner_tags,
163
  }
164
 
165
+