NazaGara commited on
Commit
1fd6275
·
1 Parent(s): eb8bb4c

Update wikiner.py

Browse files
Files changed (1) hide show
  1. wikiner.py +4 -2
wikiner.py CHANGED
@@ -175,7 +175,9 @@ class Wikiner(datasets.GeneratorBasedBuilder):
175
  logging.info("⏳ Generating examples from = %s", filepath)
176
  with open(filepath, encoding="utf-8") as f:
177
  guid = 0
178
- tokens, pos_tags, ner_tags = [], [], []
 
 
179
  for line in f:
180
  if line.startswith("-DOCSTART-") or line == "" or line == "\n":
181
  if tokens:
@@ -193,7 +195,7 @@ class Wikiner(datasets.GeneratorBasedBuilder):
193
  splits = line.split(" ")
194
  tokens.append(splits[0])
195
  pos_tags.append(splits[1])
196
- #ner_tags.append(splits[2].rstrip())
197
  # last example
198
  if tokens:
199
  yield guid, {
 
175
  logging.info("⏳ Generating examples from = %s", filepath)
176
  with open(filepath, encoding="utf-8") as f:
177
  guid = 0
178
+ tokens = []
179
+ pos_tags = []
180
+ ner_tags = []
181
  for line in f:
182
  if line.startswith("-DOCSTART-") or line == "" or line == "\n":
183
  if tokens:
 
195
  splits = line.split(" ")
196
  tokens.append(splits[0])
197
  pos_tags.append(splits[1])
198
+ ner_tags.append(splits[2].rstrip())
199
  # last example
200
  if tokens:
201
  yield guid, {