🚀 基于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 数据集 |