🚀 基於SciBERT的藥物命名實體識別模型
本項目是一個基於SciBERT的模型,經過微調後可用於識別藥物名稱和藥物不良反應的命名實體。該模型能有效解決醫療文本中藥物及不良反應實體識別的問題,為醫療信息的提取和分析提供了有力支持。
🚀 快速開始
本模型將輸入的標記分類為以下五類:
B-DRUG
:藥物實體的開始
I-DRUG
:藥物實體內
B-EFFECT
:不良反應(AE)實體的開始
I-EFFECT
:不良反應實體內
O
:不屬於上述任何實體
若要開始使用此模型進行推理,只需按照以下方式設置一個命名實體識別(NER)pipeline
:
from transformers import (AutoModelForTokenClassification,
AutoTokenizer,
pipeline,
)
model_checkpoint = "jsylee/scibert_scivocab_uncased-finetuned-ner"
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint, num_labels=5,
id2label={0: 'O', 1: 'B-DRUG', 2: 'I-DRUG', 3: 'B-EFFECT', 4: 'I-EFFECT'}
)
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model_pipeline = pipeline(task="ner", model=model, tokenizer=tokenizer)
print( model_pipeline ("Abortion, miscarriage or uterine hemorrhage associated with misoprostol (Cytotec), a labor-inducing drug."))
✨ 主要特性
- 基於SciBERT進行微調,在藥物命名實體識別任務上表現出色。
- 能夠準確識別藥物名稱和藥物不良反應實體。
- 提供了直觀的五類分類方式,便於理解和應用。
📚 詳細文檔
模型架構

相關鏈接
- SciBERT:https://huggingface.co/allenai/scibert_scivocab_uncased
- 數據集:https://huggingface.co/datasets/ade_corpus_v2
示例輸入
以下是一些示例輸入文本及其標題:
- 文本:"Abortion, miscarriage or uterine hemorrhage associated with misoprostol (Cytotec), a labor-inducing drug.",示例標題:"Abortion, miscarriage, ..."
- 文本:"Addiction to many sedatives and analgesics, such as diazepam, morphine, etc.",示例標題:"Addiction to many..."
- 文本:"Birth defects associated with thalidomide",示例標題:"Birth defects associated..."
- 文本:"Bleeding of the intestine associated with aspirin therapy",示例標題:"Bleeding of the intestine..."
- 文本:"Cardiovascular disease associated with COX-2 inhibitors (i.e. Vioxx)",示例標題:"Cardiovascular disease..."
📦 信息表格
屬性 |
詳情 |
模型類型 |
基於SciBERT微調的命名實體識別模型 |
訓練數據 |
ade_corpus_v2 數據集 |