🚀 生物實體命名實體識別模型sd-ner
本模型是一個基於RoBERTa架構的模型,用於對生物實體進行命名實體識別。它能夠識別生命科學領域英文文本中的多種生物實體,為生物信息的處理和分析提供了有力支持。
🚀 快速開始
模型描述
本模型基於 RoBERTa基礎模型,使用 BioLang數據集 中的英文生命科學文本示例,通過掩碼語言建模任務進行進一步訓練。隨後,在SourceData的 sd-nlp 數據集上,使用 NER
配置進行了詞元分類的微調,以實現生物實體的命名實體識別。
預期用途和侷限性
使用方法
該模型旨在對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
分詞器一起使用。
📦 安裝指南
文檔未提及安裝相關內容,可參考 transformers
庫的安裝方法進行安裝。
📚 詳細文檔
訓練數據
該模型使用 EMBO/sd-nlp數據集 進行詞元分類訓練,該數據集包含手動註釋的示例。
訓練過程
訓練在配備4個NVIDIA Tesla V100 GPU的NVIDIA DGX Station上進行。
訓練代碼可在 https://github.com/source-data/soda-roberta 找到。
屬性 |
詳情 |
微調模型 |
EMBO/bio-lm |
分詞器詞彙量 |
50265 |
訓練數據 |
EMBO/sd-nlp |
數據集配置 |
NER |
訓練樣本數 |
48771 |
評估樣本數 |
13801 |
訓練特徵 |
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。