🚀 BiomedNLP - PubMedBERT-base-uncased-abstract-fulltext_pub_section
本項目是一個用於文檔段落文本分類的模型,基於microsoft/BiomedNLP - PubMedBERT-base-uncased-abstract-fulltext
進行微調。可對醫學文檔的不同段落進行分類,如背景、結論、方法、目標、結果等。
🚀 快速開始
安裝依賴
根據需要安裝transformers
庫:
pip install -U transformers
運行示例
運行以下代碼,將示例文本替換為你的實際用例:
from transformers import pipeline
model_tag = "ml4pubmed/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext_pub_section"
classifier = pipeline(
'text-classification',
model=model_tag,
)
prompt = """
Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train.
"""
classifier(
prompt,
)
✨ 主要特性
- 適用數據集:
pubmed
、ml4pubmed/pubmed-classification-20k
。
- 評估指標:
f1
。
- 支持任務:文本分類、文檔段落分類、句子分類、文檔分類等醫學相關的文本分類任務。
📦 安裝指南
若需要使用該模型,需安裝transformers
庫,安裝命令如下:
pip install -U transformers
💻 使用示例
基礎用法
from transformers import pipeline
model_tag = "ml4pubmed/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext_pub_section"
classifier = pipeline(
'text-classification',
model=model_tag,
)
prompt = """
Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train.
"""
classifier(
prompt,
)
🔧 技術細節
訓練指標
指標 |
數值 |
val_accuracy |
0.8678670525550842 |
val_matthewscorrcoef |
0.8222037553787231 |
val_f1score |
0.866841197013855 |
val_cross_entropy |
0.3674609065055847 |
epoch |
8.0 |
train_accuracy_step |
0.83984375 |
train_matthewscorrcoef_step |
0.7790813446044922 |
train_f1score_step |
0.837363600730896 |
train_cross_entropy_step |
0.39843088388442993 |
train_accuracy_epoch |
0.8538406491279602 |
train_matthewscorrcoef_epoch |
0.8031334280967712 |
train_f1score_epoch |
0.8521654605865479 |
train_cross_entropy_epoch |
0.4116102457046509 |
test_accuracy |
0.8578397035598755 |
test_matthewscorrcoef |
0.8091378808021545 |
test_f1score |
0.8566917181015015 |
test_cross_entropy |
0.3963385224342346 |
date_run |
Apr - 22 - 2022_t - 19 |
huggingface_tag |
microsoft/BiomedNLP - PubMedBERT - base - uncased - abstract - fulltext |
📄 許可證
本項目採用apache - 2.0
許可證。