ramybaly commited on
Commit
8762e84
·
1 Parent(s): 9ada35a

fixed bug in dataset script

Browse files
Files changed (1) hide show
  1. nerd.py +5 -5
nerd.py CHANGED
@@ -180,7 +180,7 @@ class NERD(datasets.GeneratorBasedBuilder):
180
  guid = 0
181
  tokens = []
182
  ner_tags = []
183
- ner_tags_fine = []
184
 
185
  for line in lines:
186
  if line.startswith("-DOCSTART-") or line.strip() == "" or line == "\n":
@@ -189,22 +189,22 @@ class NERD(datasets.GeneratorBasedBuilder):
189
  "id": str(guid),
190
  "tokens": tokens,
191
  "ner_tags": ner_tags,
192
- "ner_tags_fine": ner_tags_fine,
193
  }
194
  guid += 1
195
  tokens = []
196
  ner_tags = []
197
- ner_tags_fine = []
198
  else:
199
  # nerd tokens are tab- separated
200
  splits = line.split('\t')
201
  tokens.append(splits[0])
202
  ner_tags.append(splits[1])
203
- ner_tags_fine.append(splits[2].rstrip())
204
  # last example
205
  yield guid, {
206
  "id": str(guid),
207
  "tokens": tokens,
208
  "ner_tags": ner_tags,
209
- "ner_tags_fine": ner_tags_fine,
210
  }
 
180
  guid = 0
181
  tokens = []
182
  ner_tags = []
183
+ # ner_tags_fine = []
184
 
185
  for line in lines:
186
  if line.startswith("-DOCSTART-") or line.strip() == "" or line == "\n":
 
189
  "id": str(guid),
190
  "tokens": tokens,
191
  "ner_tags": ner_tags,
192
+ # "ner_tags_fine": ner_tags_fine,
193
  }
194
  guid += 1
195
  tokens = []
196
  ner_tags = []
197
+ # ner_tags_fine = []
198
  else:
199
  # nerd tokens are tab- separated
200
  splits = line.split('\t')
201
  tokens.append(splits[0])
202
  ner_tags.append(splits[1])
203
+ # ner_tags_fine.append(splits[2].rstrip())
204
  # last example
205
  yield guid, {
206
  "id": str(guid),
207
  "tokens": tokens,
208
  "ner_tags": ner_tags,
209
+ # "ner_tags_fine": ner_tags_fine,
210
  }