Datasets:
Dr. Jorge Abreu Vicente commited on
Commit ·
b97c07d
1
Parent(s): 72bc61d
All NER sets working
Browse files6 unmodified lines78910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686940 unmodified lines1101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531548 unmodified lines1631641651661671686 unmodified linesimport shutilfrom constants import CITATIONS, DESCRIPTIONS, HOMEPAGES, DATA_URL_CITATION = """\@article{2022,title={Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing},volume={3},ISSN={2637-8051},url={http://dx.doi.org/10.1145/3458754},DOI={10.1145/3458754},number={1},journal={ACM Transactions on Computing for Healthcare},publisher={Association for Computing Machinery (ACM)},author={Gu, Yu and Tinn, Robert and Cheng, Hao and Lucas, Michael and Usuyama, Naoto and Liu, Xiaodong and Naumann, Tristan and Gao, Jianfeng and Poon, Hoifung},year={2022},month={Jan},pages={1–23}}"""_DESCRIPTION = """BLURB (Biomedical Language Understanding and Reasoning Benchmark.)is a comprehensive benchmark for biomedical NLP, with 13 biomedical NLP datasets in 6tasks (NER, PICO, Relation Extraction, Sentence similarity, document classification, question answering).Our aim is to facilitate investigations of biomedical natural language processingwith a specific focus on language model pretraining and to help accelerate progress in universal BiomedicalNLP applications. The table below compares the datasets comprising BLURB versus the various datasets used inprevious Biomedical and Clinical BERT language models."""_HOMEPAGE = "https://microsoft.github.io/BLURB/index.html"_LICENSE = "TBD"_VERSION = "1.0.0"DATA_DIR = "blurb/"logger = datasets.logging.get_logger(__name__)CITATION_BC5_CHEM = """@article{article,author = {Li, Jiao and Sun, Yueping and Johnson, Robin and Sciaky, Daniela and Wei, Chih-Hsuan and Leaman, Robert and Davis, Allan Peter and Mattingly, Carolyn and Wiegers, Thomas and lu, Zhiyong},year = {2016},month = {05},pages = {baw068},title = {BioCreative V CDR task corpus: a resource for chemical disease relation extraction},volume = {2016},journal = {Database},doi = {10.1093/database/baw068}}"""CITATION_BC2_GENE = """@article{article,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.},year = {2008},month = {09},pages = {S2},title = {Overview of BioCreative II gene mention recognition},volume = {9 Suppl 2},journal = {Genome biology},doi = {10.1186/gb-2008-9-s2-s2}}"""class BlurbConfig(datasets.BuilderConfig):"""BuilderConfig for BLURB."""40 unmodified linesBUILDER_CONFIGS = [BlurbConfig(name='BC5CDR-chem-IOB', task='ner', label_classes=['O', 'B-Chemical', 'I-Chemical'],data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",description="""The corpus consists of three separate sets ofarticles with diseases, chemicals and their relations annotated.The training (500 articles) and development (500 articles) setswere released to task participants in advance to support text-miningmethod development. The test set (500 articles) was used for finalsystem performance evaluation.""",citation=CITATION_BC5_CHEM,homepage="https://biocreative.bioinformatics.udel.edu/resources/corpora/biocreative-v-cdr-corpus"),BlurbConfig(name='BC5CDR-disease-IOB', task='ner', label_classes=['O', 'B-Disease', 'I-Disease'],data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",description="""The corpus consists of three separate sets ofarticles with diseases, chemicals and their relations annotated.The training (500 articles) and development (500 articles) setswere released to task participants in advance to support text-miningmethod development. The test set (500 articles) was used for finalsystem performance evaluation.""",citation=CITATION_BC5_CHEM,homepage="https://biocreative.bioinformatics.udel.edu/resources/corpora/biocreative-v-cdr-corpus"),BlurbConfig(name='BC2GM-IOB', task='ner', label_classes=['O', 'B-GENE', 'I-GENE'],data_url = "https://github.com/cambridgeltl/MTL-Bioinformatics-2016/raw/master/data/",description="""The BioCreative II Gene Mention task.The training corpus for the current task consists mainly ofthe training and testing corpora (text collections) from theBCI task, and the testing corpus for the current taskconsists of an additional 5,000 sentences that were held'in reserve' from the previous task.In the current corpus, tokenization is not provided;instead participants are asked to identify a gene mentionin a sentence by giving its start and end characters.As before, the training set consists of a set of sentences,and for each sentence a set of gene mentions(GENE annotations).""",citation=CITATION_BC2_GENE,homepage="https://biocreative.bioinformatics.udel.edu/tasks/biocreative-ii/task-1a-gene-mention-tagging/"),]8 unmodified linesdef _split_generators(self, dl_manager):"""Returns SplitGenerators."""if self.config.task == 'ner':downloaded_files = dl_manager.download_and_extract(self.config.urls)6 unmodified lines78910111213141516171840 unmodified lines59606162636465666768697071727374757677787980818283848586878889909192939495968 unmodified lines1051061071081091101111121131146 unmodified linesimport shutilfrom constants import CITATIONS, DESCRIPTIONS, HOMEPAGES, DATA_URL_LICENSE = "TBD"_VERSION = "1.0.0"DATA_DIR = "blurb/"logger = datasets.logging.get_logger(__name__)class BlurbConfig(datasets.BuilderConfig):"""BuilderConfig for BLURB."""40 unmodified linesBUILDER_CONFIGS = [BlurbConfig(name='BC5CDR-chem-IOB', task='ner', label_classes=['O', 'B-Chemical', 'I-Chemical'],data_url = DATA_URL['BC5CDR-chem-IOB'],description=DESCRIPTIONS['BC5CDR-chem-IOB'],citation=CITATIONS['BC5CDR-chem-IOB'],homepage=HOMEPAGES['BC5CDR-chem-IOB']),BlurbConfig(name='BC5CDR-disease-IOB', task='ner', label_classes=['O', 'B-Disease', 'I-Disease'],data_url = DATA_URL['BC5CDR-disease-IOB'],description=DESCRIPTIONS['BC5CDR-disease-IOB'],citation=CITATIONS['BC5CDR-disease-IOB'],homepage=HOMEPAGES['BC5CDR-disease-IOB']),BlurbConfig(name='BC2GM-IOB', task='ner', label_classes=['O', 'B-GENE', 'I-GENE'],data_url = DATA_URL['BC2GM-IOB'],description=DESCRIPTIONS['BC2GM-IOB'],citation=CITATIONS['BC2GM-IOB'],homepage=HOMEPAGES['BC2GM-IOB']),BlurbConfig(name='NCBI-disease-IOB', task='ner', label_classes=['O', 'B-Disease', 'I-Disease'],data_url = DATA_URL['NCBI-disease-IOB'],description=DESCRIPTIONS['NCBI-disease-IOB'],citation=CITATIONS['NCBI-disease-IOB'],homepage=HOMEPAGES['NCBI-disease-IOB']),BlurbConfig(name='JNLPBA', task='ner', label_classes=['O', 'B-protein', 'I-protein','B-cell_type', 'I-cell_type','B-cell_line', 'I-cell_line','B-DNA','I-DNA', 'B-RNA', 'I-RNA'],data_url = DATA_URL['JNLPBA'],description=DESCRIPTIONS['JNLPBA'],citation=CITATIONS['JNLPBA'],homepage=HOMEPAGES['JNLPBA']),]8 unmodified linesdef _split_generators(self, dl_manager):"""Returns SplitGenerators."""print(self.config.base_url)print(self.config.data_url)for i in self.config.urls:print(self.config.urls[i])if self.config.task == 'ner':downloaded_files = dl_manager.download_and_extract(self.config.urls)
BLURB.py+33-87