Commit
·
2658df3
1
Parent(s):
9d65c48
Update bionlp2.py
Browse files- bionlp2.py +5 -5
bionlp2.py
CHANGED
|
@@ -5,7 +5,7 @@ import datasets
|
|
| 5 |
|
| 6 |
logger = datasets.logging.get_logger(__name__)
|
| 7 |
_DESCRIPTION = """[BioNLP2004 NER dataset](https://aclanthology.org/W04-1213.pdf)"""
|
| 8 |
-
_NAME = "
|
| 9 |
_VERSION = "1.0.0"
|
| 10 |
_CITATION = """
|
| 11 |
@inproceedings{collier-kim-2004-introduction,
|
|
@@ -89,14 +89,14 @@ class BioNLP2004(datasets.GeneratorBasedBuilder):
|
|
| 89 |
print(data)
|
| 90 |
|
| 91 |
nlist = []
|
| 92 |
-
for indx in data["
|
| 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 |
-
del data['tags']
|
| 97 |
xstr = str(_key)
|
| 98 |
-
yield xstr,{"id":xstr,"tokens":data['tokens'], "nertags":data['ner_tags']}
|
| 99 |
-
|
| 100 |
_key += 1
|
| 101 |
|
| 102 |
def _info(self):
|
|
|
|
| 5 |
|
| 6 |
logger = datasets.logging.get_logger(__name__)
|
| 7 |
_DESCRIPTION = """[BioNLP2004 NER dataset](https://aclanthology.org/W04-1213.pdf)"""
|
| 8 |
+
_NAME = "bionlp2"
|
| 9 |
_VERSION = "1.0.0"
|
| 10 |
_CITATION = """
|
| 11 |
@inproceedings{collier-kim-2004-introduction,
|
|
|
|
| 89 |
print(data)
|
| 90 |
|
| 91 |
nlist = []
|
| 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 |
+
#del data['tags']
|
| 97 |
xstr = str(_key)
|
| 98 |
+
#yield xstr,{"id":xstr,"tokens":data['tokens'], "nertags":data['ner_tags']}
|
| 99 |
+
yield _key,data
|
| 100 |
_key += 1
|
| 101 |
|
| 102 |
def _info(self):
|