Datasets:
Tasks:
Token Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
10K - 100K
License:
Commit
•
36bc69a
1
Parent(s):
4ee9af4
Do not yield trailing empty example
Browse files- bc2gm_corpus.py +6 -5
bc2gm_corpus.py
CHANGED
@@ -135,8 +135,9 @@ class Bc2gmCorpus(datasets.GeneratorBasedBuilder):
|
|
135 |
tokens.append(splits[0])
|
136 |
ner_tags.append(splits[1].rstrip())
|
137 |
# last example
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
135 |
tokens.append(splits[0])
|
136 |
ner_tags.append(splits[1].rstrip())
|
137 |
# last example
|
138 |
+
if tokens:
|
139 |
+
yield guid, {
|
140 |
+
"id": str(guid),
|
141 |
+
"tokens": tokens,
|
142 |
+
"ner_tags": ner_tags,
|
143 |
+
}
|