🚀 BioM-Transformers:使用BERT、ALBERT和ELECTRA构建大型生物医学语言模型
BioM-Transformers旨在利用不同设计选择,借助大型Transformer模型进行生物医学领域适配研究。通过与现有生物医学语言模型对比评估,该项目在多个生物医学领域任务中取得了卓越成果,同时展现了设计选择对提升模型性能的显著影响。
🚀 快速开始
你可以通过以下方式快速开始使用BioM-Transformers:
✨ 主要特性
- 高性能:在多个生物医学领域任务中取得了最先进的结果,且计算成本与其他模型相当或更低。
- 资源支持:为资源有限的研究人员提供了使用PyTorch XLA在TPU上微调模型的示例,可免费使用Google Colab和Kaggle提供的TPU资源。
- 丰富示例:仓库中包含多个Colab Notebook示例,涵盖命名实体识别(NER)、文本分类、问答等任务。
📦 安装指南
文档未提及具体安装步骤,可参考GitHub仓库中的相关说明进行安装。
💻 使用示例
基础用法
可参考以下Colab Notebook示例进行基础使用:
高级用法
使用PyTorch XLA在免费TPU上进行文本分类任务的微调:
在免费TPU上使用HuggingFace Transformers和PyTorch XLA进行生物医学模型的微调
在该示例中,使用BioM-ALBERTxxlarge在ChemProt任务上实现了80.74的微F1分数,5个epoch的微调时间为43分钟。
📚 详细文档
模型描述
该模型在PMC全文文章上进行了额外64k步的预训练,批量大小为8192,权重初始化自BioM-ALBERT-xxlarge模型。因此,该模型的总训练步数为264k + 64k = 328k步。由于隐藏层大小为4096,模型规模非常大。
为帮助资源有限的研究人员微调更大的模型,项目提供了一个使用PyTorch XLA的示例。PyTorch XLA(https://github.com/pytorch/xla)是一个允许在TPU单元上使用PyTorch的库,Google Colab和Kaggle免费提供TPU资源。可参考此示例进行PyTorch/XLA的使用。
Colab Notebook示例
🔧 技术细节
该项目通过实证研究,使用不同设计选择的大型Transformer模型进行生物医学领域适配。评估了预训练模型相对于文献中其他现有生物医学语言模型的性能,结果表明在多个生物医学领域任务中取得了最先进的结果,同时强调了设计选择对提高生物医学语言模型性能的显著影响。
📄 许可证
文档未提及许可证信息。
🙏 致谢
感谢Tensorflow Research Cloud (TFRC)团队为我们提供TPUv3单元的访问权限。
📖 引用
@inproceedings{alrowili-shanker-2021-biom,
title = "{B}io{M}-Transformers: Building Large Biomedical Language Models with {BERT}, {ALBERT} and {ELECTRA}",
author = "Alrowili, Sultan and
Shanker, Vijay",
booktitle = "Proceedings of the 20th Workshop on Biomedical Language Processing",
month = jun,
year = "2021",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2021.bionlp-1.24",
pages = "221--227",
abstract = "The impact of design choices on the performance of biomedical language models recently has been a subject for investigation. In this paper, we empirically study biomedical domain adaptation with large transformer models using different design choices. We evaluate the performance of our pretrained models against other existing biomedical language models in the literature. Our results show that we achieve state-of-the-art results on several biomedical domain tasks despite using similar or less computational cost compared to other models in the literature. Our findings highlight the significant effect of design choices on improving the performance of biomedical language models.",
}