Skip to content

Commit a1e7dff

Browse files
committed
[ehealth] fix annotation and README
1 parent 832e8a7 commit a1e7dff

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

examples/biomedical/cblue/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ cblue/
4444
└── export_model.py #动态图参数导出静态图参数脚本
4545
```
4646

47+
### 依赖安装
48+
49+
```shell
50+
pip install xlrd==1.2.0
51+
```
52+
4753
### 模型训练
4854

4955
我们按照任务类别划分,同时提供了8个任务的样例代码。可以运行下边的命令,在训练集上进行训练,并在开发集上进行验证。
@@ -98,24 +104,19 @@ $ python -m paddle.distributed.launch --gpus "0,1,2,3" train_classification.py -
98104

99105
* `dataset`:可选,CHIP-CDN-2C CHIP-CTC CHIP-STS KUAKE-QIC KUAKE-QTR KUAKE-QQR,默认为KUAKE-QIC数据集。
100106

101-
#### 医疗命名实体识别任务
107+
#### 医疗命名实体识别任务(CMeEE)
102108

103109
```shell
104110
$ export CUDA_VISIBLE_DEVICES=0
105111
$ python train_ner.py --batch_size 32 --max_seq_length 128 --learning_rate 6e-5 --epochs 12
106112
```
107113

108-
#### 医疗关系抽取任务
114+
#### 医疗关系抽取任务(CMeIE)
109115

110116
```shell
111117
$ export CUDA_VISIBLE_DEVICES=0
112118
$ python train_spo.py --batch_size 12 --max_seq_length 300 --learning_rate 6e-5 --epochs 100
113119
```
114120

115-
### 依赖安装
116-
117-
```shell
118-
pip install xlrd==1.2.0
119-
```
120-
121121
[1] CBLUE: A Chinese Biomedical Language Understanding Evaluation Benchmark [pdf](https://arxiv.org/abs/2106.08087) [git](https://github.com/CBLUEbenchmark/CBLUE) [web](https://tianchi.aliyun.com/specials/promotion/2021chinesemedicalnlpleaderboardchallenge)
122+
[2] Wang, Quan, et al. “Building Chinese Biomedical Language Models via Multi-Level Text Discrimination.” arXiv preprint arXiv:2110.07244 (2021). [pdf](https://arxiv.org/abs/2110.07244)

examples/biomedical/cblue/train_spo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def batchify_fn(data):
151151
# - one_hot_spo_label: # shape (num_predicate, sequence_length, sequence_length)
152152
# [...,
153153
# [..., [0, ..., 1, ..., 0], ...], # for predicate '相关(导致)'
154-
# ...] # the value at [23, 0, 9] is set as 1
154+
# ...] # the value at [23, 1, 10] is set as 1
155155
#
156156
one_hot_ent_label = np.zeros(
157157
[batch_size, batch_len, 2], dtype=np.float32)

0 commit comments

Comments
 (0)