BuptZZP commited on
Commit
d7ab850
·
verified ·
1 Parent(s): 852191b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -50
README.md CHANGED
@@ -1,50 +1,52 @@
1
- ---
2
- license: apache-2.0
3
- tags:
4
- - ner
5
- - medical
6
- - chinese
7
- - pytorch
8
- - crf
9
- language: zh
10
- model-index:
11
- - name: MedBERT-BiLSTM-CRF (中文医疗实体识别模型)
12
- results: []
13
- ---
14
-
15
- # 中文医疗实体识别模型:MedBERT-BiLSTM-CRF
16
-
17
- 本模型基于 [trueto/medbert-base-chinese](https://huggingface.co/trueto/medbert-base-chinese) 预训练模型,结合 BiLSTM 和 CRF 构建而成,用于中文医疗命名实体识别(NER)任务。
18
-
19
- ## 🧠 模型结构
20
-
21
- - 编码器:MedBERT
22
- - 上下文建模:BiLSTM(双向 LSTM)
23
- - 序列解码:CRF(条件随机场)
24
- - 标签体系:BIO(13类)
25
-
26
- 支持的实体类别包括:
27
- - Anatomical(解剖结构)
28
- - Diseases(疾病)
29
- - Drug(药品)
30
- - Image(影像检查)
31
- - Laboratory(实验室指标)
32
- - Operation(手术操作)
33
-
34
- ## 📦 使用说明(PyTorch)
35
-
36
- 由于本模型为自定义结构(非 transformers 原生模型),请使用本项目中的结构类 `BertCRF` 进行加载:
37
-
38
- ```python
39
- from bert_crf_model import BertCRF
40
- import torch
41
-
42
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
43
-
44
- model = BertCRF(
45
- bert_model_name="trueto/medbert-base-chinese",
46
- num_labels=13
47
- )
48
- model.load_state_dict(torch.load("pytorch_model.bin", map_location=device))
49
- model.to(device)
50
- model.eval()
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - ner
5
+ - medical
6
+ - chinese
7
+ - pytorch
8
+ - crf
9
+ language: zh
10
+ pretrained_model: trueto/medbert-base-chinese
11
+ use_bilstm: true
12
+ use_attention: false
13
+ model-index:
14
+ - name: MedBERT-BiLSTM-CRF (中文医疗实体识别模型)
15
+ results: []
16
+ ---
17
+ # 中文医疗实体识别模型:MedBERT-BiLSTM-CRF
18
+
19
+ 本模型基于 [trueto/medbert-base-chinese](https://huggingface.co/trueto/medbert-base-chinese) 预训练模型,结合 BiLSTM 和 CRF 构建而成,用于中文医疗命名实体识别(NER)任务。
20
+
21
+ ## 🧠 模型结构
22
+
23
+ - 编码器:MedBERT
24
+ - 上下文建模:BiLSTM(双向 LSTM)
25
+ - 序列解码:CRF(条件随机场)
26
+ - 标签体系:BIO(13类)
27
+
28
+ 支持的实体类别包括:
29
+ - Anatomical(解剖结构)
30
+ - Diseases(疾病)
31
+ - Drug(药品)
32
+ - Image(影像检查)
33
+ - Laboratory(实验室指标)
34
+ - Operation(手术操作)
35
+
36
+ ## 📦 使用说明(PyTorch)
37
+
38
+ 由于本模型为自定义结构(非 transformers 原生模型),请使用本项目中的结构类 `BertCRF` 进行加载:
39
+
40
+ ```python
41
+ from bert_crf_model import BertCRF
42
+ import torch
43
+
44
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
45
+
46
+ model = BertCRF(
47
+ bert_model_name="trueto/medbert-base-chinese",
48
+ num_labels=13
49
+ )
50
+ model.load_state_dict(torch.load("pytorch_model.bin", map_location=device))
51
+ model.to(device)
52
+ model.eval()