Update Entityrecongnitionjobs.py
Browse files
Entityrecongnitionjobs.py
CHANGED
@@ -218,8 +218,6 @@ class Conll2003(datasets.GeneratorBasedBuilder):
|
|
218 |
with open(filepath, encoding="utf-8") as f:
|
219 |
guid = 0
|
220 |
tokens = []
|
221 |
-
pos_tags = []
|
222 |
-
chunk_tags = []
|
223 |
ner_tags = []
|
224 |
for line in f:
|
225 |
if line.startswith("-DOCSTART-") or line == "" or line == "\n":
|
@@ -227,8 +225,6 @@ class Conll2003(datasets.GeneratorBasedBuilder):
|
|
227 |
yield guid, {
|
228 |
"id": str(guid),
|
229 |
"tokens": tokens,
|
230 |
-
"pos_tags": pos_tags,
|
231 |
-
"chunk_tags": chunk_tags,
|
232 |
"ner_tags": ner_tags,
|
233 |
}
|
234 |
guid += 1
|
@@ -240,15 +236,11 @@ class Conll2003(datasets.GeneratorBasedBuilder):
|
|
240 |
# conll2003 tokens are space separated
|
241 |
splits = line.split(" ")
|
242 |
tokens.append(splits[0])
|
243 |
-
|
244 |
-
chunk_tags.append(splits[2])
|
245 |
-
ner_tags.append(splits[3].rstrip())
|
246 |
# last example
|
247 |
if tokens:
|
248 |
yield guid, {
|
249 |
"id": str(guid),
|
250 |
"tokens": tokens,
|
251 |
-
"pos_tags": pos_tags,
|
252 |
-
"chunk_tags": chunk_tags,
|
253 |
"ner_tags": ner_tags,
|
254 |
}
|
|
|
218 |
with open(filepath, encoding="utf-8") as f:
|
219 |
guid = 0
|
220 |
tokens = []
|
|
|
|
|
221 |
ner_tags = []
|
222 |
for line in f:
|
223 |
if line.startswith("-DOCSTART-") or line == "" or line == "\n":
|
|
|
225 |
yield guid, {
|
226 |
"id": str(guid),
|
227 |
"tokens": tokens,
|
|
|
|
|
228 |
"ner_tags": ner_tags,
|
229 |
}
|
230 |
guid += 1
|
|
|
236 |
# conll2003 tokens are space separated
|
237 |
splits = line.split(" ")
|
238 |
tokens.append(splits[0])
|
239 |
+
ner_tags.append(splits[1].rstrip())
|
|
|
|
|
240 |
# last example
|
241 |
if tokens:
|
242 |
yield guid, {
|
243 |
"id": str(guid),
|
244 |
"tokens": tokens,
|
|
|
|
|
245 |
"ner_tags": ner_tags,
|
246 |
}
|