Commit
·
1c4dafb
1
Parent(s):
fd7e7d9
Update bionlp2.py
Browse files- bionlp2.py +5 -5
bionlp2.py
CHANGED
@@ -92,10 +92,10 @@ class BioNLP2004(datasets.GeneratorBasedBuilder):
|
|
92 |
for indx in data["ner_tags"]:
|
93 |
nlist.append(custom_names.index(inv_map[indx]))
|
94 |
#data['ner_tags'] = map_ner_tags(data['ner_tags'])
|
95 |
-
data[
|
96 |
-
|
97 |
-
|
98 |
-
yield _key,data
|
99 |
_key += 1
|
100 |
|
101 |
def _info(self):
|
@@ -106,7 +106,7 @@ class BioNLP2004(datasets.GeneratorBasedBuilder):
|
|
106 |
description=_DESCRIPTION,
|
107 |
features=datasets.Features(
|
108 |
{
|
109 |
-
|
110 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
111 |
"ner_tags": datasets.Sequence(
|
112 |
datasets.features.ClassLabel(
|
|
|
92 |
for indx in data["ner_tags"]:
|
93 |
nlist.append(custom_names.index(inv_map[indx]))
|
94 |
#data['ner_tags'] = map_ner_tags(data['ner_tags'])
|
95 |
+
data['ner_tags']=nlist
|
96 |
+
xstr = str(_key)
|
97 |
+
yield xstr,{"id":xstr,"tokens":data['tokens'], "nertags":data["ner_tags"]}
|
98 |
+
#yield _key,data
|
99 |
_key += 1
|
100 |
|
101 |
def _info(self):
|
|
|
106 |
description=_DESCRIPTION,
|
107 |
features=datasets.Features(
|
108 |
{
|
109 |
+
"id": datasets.Value("string"),
|
110 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
111 |
"ner_tags": datasets.Sequence(
|
112 |
datasets.features.ClassLabel(
|