🚀 sd-ner
このモデルは、生命科学分野の英語の科学的テキスト例を集めたコンパendiumを使用して、マスク付き言語モデリングタスクでさらに学習されたRoBERTaベースモデルです。学習にはBioLangデータセットを使用しています。その後、SourceDataのsd-nlpデータセットでNER
設定を用いてトークン分類のために微調整され、生物実体の固有表現認識を行うことができます。
🚀 クイックスタート
モデルの概要
このモデルは、RoBERTaベースモデルをベースに、生命科学分野の英語の科学的テキスト例を用いたマスク言語モデリングタスクで追加学習され、その後、SourceDataのsd-nlpデータセットでトークン分類のために微調整され、生物実体の固有表現認識を行います。
想定される使用目的と制限
使い方
このモデルの想定される使用目的は、SourceDataの注釈(https://sourcedata.embo.org)で使用される生物学的実体の固有表現認識です。これには、小分子、遺伝子産物(遺伝子とタンパク質)、細胞内成分、細胞株と細胞型、臓器と組織、種、および実験方法が含まれます。
モデルを簡単に確認するには、以下のコードを使用します。
from transformers import pipeline, RobertaTokenizerFast, RobertaForTokenClassification
example = """<s> F. Western blot of input and eluates of Upf1 domains purification in a Nmd4-HA strain. The band with the # might corresponds to a dimer of Upf1-CH, bands marked with a star correspond to residual signal with the anti-HA antibodies (Nmd4). Fragments in the eluate have a smaller size because the protein A part of the tag was removed by digestion with the TEV protease. G6PDH served as a loading control in the input samples </s>"""
tokenizer = RobertaTokenizerFast.from_pretrained('roberta-base', max_len=512)
model = RobertaForTokenClassification.from_pretrained('EMBO/sd-ner')
ner = pipeline('ner', model, tokenizer=tokenizer)
res = ner(example)
for r in res:
print(r['word'], r['entity'])
制限とバイアス
このモデルはroberta-base
トークナイザーと一緒に使用する必要があります。
学習データ
このモデルは、手動で注釈付けされた例を含むEMBO/sd-nlpデータセットを使用してトークン分類のために学習されました。
学習手順
学習は、4つのTesla V100 GPUを搭載したNVIDIA DGX Stationで行われました。学習コードはhttps://github.com/source-data/soda-robertaで入手できます。
- 微調整されたモデル: EMBO/bio-lm
- トークナイザーの語彙サイズ: 50265
- 学習データ: EMBO/sd-nlp
- データセット設定: NER
- 48771の例で学習
- 13801の例で評価
- 15の特徴で学習: O, I-SMALL_MOLECULE, B-SMALL_MOLECULE, I-GENEPROD, B-GENEPROD, I-SUBCELLULAR, B-SUBCELLULAR, I-CELL, B-CELL, I-TISSUE, B-TISSUE, I-ORGANISM, B-ORGANISM, I-EXP_ASSAY, B-EXP_ASSAY
- エポック数: 0.6
per_device_train_batch_size
: 16
per_device_eval_batch_size
: 16
learning_rate
: 0.0001
weight_decay
: 0.0
adam_beta1
: 0.9
adam_beta2
: 0.999
adam_epsilon
: 1e-08
max_grad_norm
: 1.0
評価結果
sklearn.metrics
を使用して、7178のテストセットの例でテストした結果は以下の通りです。
precision recall f1-score support
CELL 0.69 0.81 0.74 5245
EXP_ASSAY 0.56 0.57 0.56 10067
GENEPROD 0.77 0.89 0.82 23587
ORGANISM 0.72 0.82 0.77 3623
SMALL_MOLECULE 0.70 0.80 0.75 6187
SUBCELLULAR 0.65 0.72 0.69 3700
TISSUE 0.62 0.73 0.67 3207
micro avg 0.70 0.79 0.74 55616
macro avg 0.67 0.77 0.72 55616
weighted avg 0.70 0.79 0.74 55616
{'test_loss': 0.1830928772687912, 'test_accuracy_score': 0.9334821000160841, 'test_precision': 0.6987463009514112, 'test_recall': 0.789682825086306, 'test_f1': 0.7414366506288511, 'test_runtime': 61.0547, 'test_samples_per_second': 117.567, 'test_steps_per_second': 1.851}
📄 ライセンス
このモデルはAGPL-3.0ライセンスの下で提供されています。