🚀 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.",
}