Commit ·
2df6ce5
1
Parent(s): a6551d7
Update bionlp2.py
Browse files- bionlp2.py +2 -1
bionlp2.py
CHANGED
|
@@ -93,7 +93,7 @@ class BioNLP2004(datasets.GeneratorBasedBuilder):
|
|
| 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 |
-
yield _key, data
|
| 97 |
_key += 1
|
| 98 |
|
| 99 |
def _info(self):
|
|
@@ -104,6 +104,7 @@ class BioNLP2004(datasets.GeneratorBasedBuilder):
|
|
| 104 |
description=_DESCRIPTION,
|
| 105 |
features=datasets.Features(
|
| 106 |
{
|
|
|
|
| 107 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 108 |
"ner_tags": datasets.Sequence(
|
| 109 |
datasets.features.ClassLabel(
|
|
|
|
| 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 |
+
yield str(_key),{"id":str(_key),"tokens":data['tokens'], "nertags":data["ner_tags"]
|
| 97 |
_key += 1
|
| 98 |
|
| 99 |
def _info(self):
|
|
|
|
| 104 |
description=_DESCRIPTION,
|
| 105 |
features=datasets.Features(
|
| 106 |
{
|
| 107 |
+
"id": datasets.Value("string"),
|
| 108 |
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 109 |
"ner_tags": datasets.Sequence(
|
| 110 |
datasets.features.ClassLabel(
|