中文医疗实体识别模型:MedBERT-BiLSTM-CRF

本模型基于 trueto/medbert-base-chinese 预训练模型,结合 BiLSTM 和 CRF 构建而成,用于中文医疗命名实体识别(NER)任务。

🧠 模型结构

  • 编码器:MedBERT
  • 上下文建模:BiLSTM(双向 LSTM)
  • 序列解码:CRF(条件随机场)
  • 标签体系:BIO(13类)

支持的实体类别包括:

  • Anatomical(解剖结构)
  • Diseases(疾病)
  • Drug(药品)
  • Image(影像检查)
  • Laboratory(实验室指标)
  • Operation(手术操作)

📦 使用说明(PyTorch)

由于本模型为自定义结构(非 transformers 原生模型),请使用本项目中的结构类 BertCRF 进行加载:

from bert_crf_model import BertCRF
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = BertCRF(
    bert_model_name="trueto/medbert-base-chinese",
    num_labels=13
)
model.load_state_dict(torch.load("pytorch_model.bin", map_location=device))
model.to(device)
model.eval()
Downloads last month
15
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support