Datasets:
Dr. Jorge Abreu Vicente
commited on
Commit
·
9fd3e2f
1
Parent(s):
1320a6a
Added bc5-chem, bc5-disease, bc2gm. Working
Browse files
BLURB.py
CHANGED
@@ -54,11 +54,21 @@ journal = {Database},
|
|
54 |
doi = {10.1093/database/baw068}
|
55 |
}
|
56 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
class BlurbConfig(datasets.BuilderConfig):
|
59 |
"""BuilderConfig for BLURB."""
|
60 |
|
61 |
-
def __init__(self, task, data_url, citation, label_classes=("False", "True"), **kwargs):
|
62 |
"""BuilderConfig for BLURB.
|
63 |
Args:
|
64 |
task: `string` task the dataset is used for: 'ner', 'pico', 'rel-ext', 'sent-sim', 'doc-clas', 'qa'
|
@@ -78,6 +88,7 @@ class BlurbConfig(datasets.BuilderConfig):
|
|
78 |
self.label_classes = label_classes
|
79 |
self.data_url = data_url
|
80 |
self.citation = citation
|
|
|
81 |
if self.task == 'ner':
|
82 |
self.features = datasets.Features(
|
83 |
{"id": datasets.Value("string"),
|
@@ -97,36 +108,57 @@ class BlurbConfig(datasets.BuilderConfig):
|
|
97 |
class Blurb(datasets.GeneratorBasedBuilder):
|
98 |
"""BLURB benchmark dataset for Biomedical Language Understanding and Reasoning Benchmark."""
|
99 |
|
100 |
-
|
101 |
BUILDER_CONFIGS = [
|
102 |
BlurbConfig(name='BC5CDR-chem-IOB', task='ner', label_classes=['O', 'B-Chemical', 'I-Chemical'],
|
103 |
data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",
|
104 |
-
description=
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
]
|
107 |
|
108 |
|
109 |
def _info(self):
|
110 |
return datasets.DatasetInfo(
|
111 |
-
description=
|
112 |
-
features=
|
113 |
-
{
|
114 |
-
"id": datasets.Value("string"),
|
115 |
-
"tokens": datasets.Sequence(datasets.Value("string")),
|
116 |
-
"ner_tags": datasets.Sequence(
|
117 |
-
datasets.features.ClassLabel(
|
118 |
-
names=[
|
119 |
-
"O",
|
120 |
-
"B-Chemical",
|
121 |
-
"I-Chemical",
|
122 |
-
]
|
123 |
-
)
|
124 |
-
),
|
125 |
-
}
|
126 |
-
),
|
127 |
supervised_keys=None,
|
128 |
-
homepage=
|
129 |
-
citation=
|
130 |
)
|
131 |
|
132 |
def _split_generators(self, dl_manager):
|
|
|
54 |
doi = {10.1093/database/baw068}
|
55 |
}
|
56 |
"""
|
57 |
+
CITATION_BC2_GENE = """@article{article,
|
58 |
+
author = {Smith, Larry and Tanabe, Lorraine and Ando, Rie and Kuo, Cheng-Ju and Chung, I-Fang and Hsu, Chun-Nan and Lin, Yu-Shi and Klinger, Roman and Friedrich, Christoph and Ganchev, Kuzman and Torii, Manabu and Liu, Hongfang and Haddow, Barry and Struble, Craig and Povinelli, Richard and Vlachos, Andreas and Baumgartner Jr, William and Hunter, Lawrence and Carpenter, Bob and Wilbur, W.},
|
59 |
+
year = {2008},
|
60 |
+
month = {09},
|
61 |
+
pages = {S2},
|
62 |
+
title = {Overview of BioCreative II gene mention recognition},
|
63 |
+
volume = {9 Suppl 2},
|
64 |
+
journal = {Genome biology},
|
65 |
+
doi = {10.1186/gb-2008-9-s2-s2}
|
66 |
+
}"""
|
67 |
|
68 |
class BlurbConfig(datasets.BuilderConfig):
|
69 |
"""BuilderConfig for BLURB."""
|
70 |
|
71 |
+
def __init__(self, task, data_url, citation, homepage, label_classes=("False", "True"), **kwargs):
|
72 |
"""BuilderConfig for BLURB.
|
73 |
Args:
|
74 |
task: `string` task the dataset is used for: 'ner', 'pico', 'rel-ext', 'sent-sim', 'doc-clas', 'qa'
|
|
|
88 |
self.label_classes = label_classes
|
89 |
self.data_url = data_url
|
90 |
self.citation = citation
|
91 |
+
self.homepage = homepage
|
92 |
if self.task == 'ner':
|
93 |
self.features = datasets.Features(
|
94 |
{"id": datasets.Value("string"),
|
|
|
108 |
class Blurb(datasets.GeneratorBasedBuilder):
|
109 |
"""BLURB benchmark dataset for Biomedical Language Understanding and Reasoning Benchmark."""
|
110 |
|
|
|
111 |
BUILDER_CONFIGS = [
|
112 |
BlurbConfig(name='BC5CDR-chem-IOB', task='ner', label_classes=['O', 'B-Chemical', 'I-Chemical'],
|
113 |
data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",
|
114 |
+
description="""The corpus consists of three separate sets of
|
115 |
+
articles with diseases, chemicals and their relations annotated.
|
116 |
+
The training (500 articles) and development (500 articles) sets
|
117 |
+
were released to task participants in advance to support text-mining
|
118 |
+
method development. The test set (500 articles) was used for final
|
119 |
+
system performance evaluation.""",
|
120 |
+
citation=CITATION_BC5_CHEM,
|
121 |
+
homepage="https://biocreative.bioinformatics.udel.edu/resources/corpora/biocreative-v-cdr-corpus"),
|
122 |
+
|
123 |
+
BlurbConfig(name='BC5CDR-disease-IOB', task='ner', label_classes=['O', 'B-Disease', 'I-Disease'],
|
124 |
+
data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",
|
125 |
+
description="""The corpus consists of three separate sets of
|
126 |
+
articles with diseases, chemicals and their relations annotated.
|
127 |
+
The training (500 articles) and development (500 articles) sets
|
128 |
+
were released to task participants in advance to support text-mining
|
129 |
+
method development. The test set (500 articles) was used for final
|
130 |
+
system performance evaluation.""",
|
131 |
+
citation=CITATION_BC5_CHEM,
|
132 |
+
homepage="https://biocreative.bioinformatics.udel.edu/resources/corpora/biocreative-v-cdr-corpus"),
|
133 |
+
|
134 |
+
BlurbConfig(name='BC2GM-IOB', task='ner', label_classes=['O', 'B-GENE', 'I-GENE'],
|
135 |
+
data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",
|
136 |
+
description="""The BioCreative II Gene Mention task.
|
137 |
+
The training corpus for the current task consists mainly of
|
138 |
+
the training and testing corpora (text collections) from the
|
139 |
+
BCI task, and the testing corpus for the current task
|
140 |
+
consists of an additional 5,000 sentences that were held
|
141 |
+
'in reserve' from the previous task.
|
142 |
+
In the current corpus, tokenization is not provided;
|
143 |
+
instead participants are asked to identify a gene mention
|
144 |
+
in a sentence by giving its start and end characters.
|
145 |
+
As before, the training set consists of a set of sentences,
|
146 |
+
and for each sentence a set of gene mentions
|
147 |
+
(GENE annotations).
|
148 |
+
""",
|
149 |
+
citation=CITATION_BC2_GENE,
|
150 |
+
homepage="https://biocreative.bioinformatics.udel.edu/tasks/biocreative-ii/task-1a-gene-mention-tagging/"),
|
151 |
+
|
152 |
]
|
153 |
|
154 |
|
155 |
def _info(self):
|
156 |
return datasets.DatasetInfo(
|
157 |
+
description=self.config.description,
|
158 |
+
features=self.config.features,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
supervised_keys=None,
|
160 |
+
homepage=self.config.homepage,
|
161 |
+
citation=self.config.citation,
|
162 |
)
|
163 |
|
164 |
def _split_generators(self, dl_manager):
|