🚀 BioM-Transformers: BERT、ALBERT、ELECTRAを用いた大規模生物医学言語モデルの構築
本プロジェクトでは、BERT、ALBERT、ELECTRAを用いて大規模生物医学言語モデルを構築し、設計選択が生物医学言語モデルの性能に与える影響を研究しています。
🚀 クイックスタート
本プロジェクトでは、様々な設計選択を用いて大規模トランスフォーマーモデルによる生物医学ドメイン適応を実証的に研究しています。事前学習済みモデルの性能を、文献上の他の既存の生物医学言語モデルと比較評価しています。
✨ 主な機能
- 本モデルは、SQuAD2.0データセットでファインチューニングされ、その後BioASQ8B-Factoidトレーニングデータセットでもファインチューニングされています。BioASQ8B-FactoidトレーニングデータセットをSQuAD1.1形式に変換し、このデータセットでモデル(BioM-ELECTRA-Base-SQuAD2)をトレーニングおよび評価しています。
- このモデルは、ファインチューニングせずに直接予測(推論)を行うことができます。このモデルカードのコンテキストボックスにPubMedのアブストラクトを入力し、与えられたコンテキスト内でいくつかの生物医学的な質問を試してみると、元のELECTRAモデルと比較してどのように機能するかを確認できます。このモデルは、パンデミック用のQAシステム(例:COVID-19)の作成にも役立つはずです。
- このバージョン(PyTorch)は、BioASQ9Bへの参加で使用したもの(Layer-Wise Decayを用いたTensorFlow)とは異なります。BioASQ8Bテストデータセットの5つのバッチをすべて1つのdev.jsonファイルとして結合しています。
📦 インストール
以下のコマンドを使用してモデルをトレーニングできます。
python3 run_squad.py --model_type electra --model_name_or_path sultan/BioM-ELECTRA-Large-SQuAD2 \
--train_file BioASQ8B/train.json \
--predict_file BioASQ8B/dev.json \
--do_lower_case \
--do_train \
--do_eval \
--threads 20 \
--version_2_with_negative \
--num_train_epochs 3 \
--learning_rate 5e-5 \
--max_seq_length 512 \
--doc_stride 128 \
--per_gpu_train_batch_size 8 \
--gradient_accumulation_steps 2 \
--per_gpu_eval_batch_size 128 \
--logging_steps 50 \
--save_steps 5000 \
--fp16 \
--fp16_opt_level O1 \
--overwrite_output_dir \
--output_dir BioM-ELECTRA-Large-SQuAD-BioASQ \
--overwrite_cache
📚 ドキュメント
モデル性能の比較
以下は、私たちのモデルと元のELECTRA baseおよびlargeの非公式な比較結果です。
モデル |
完全一致率 (EM) |
F1スコア |
ELECTRA-Base-SQuAD2-BioASQ8B |
61.89 |
74.39 |
BioM-ELECTRA-Base-SQuAD2-BioASQ8B |
70.31 |
80.90 |
ELECTRA-Large-SQuAD2-BioASQ8B |
67.36 |
78.90 |
BioM-ELECTRA-Large-SQuAD2-BioASQ8B |
74.31 |
84.72 |
📄 ライセンス
本プロジェクトでは、Tensorflow Research Cloud (TFRC) チームからの支援を受けています。
📚 引用
@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.",
}