Skip to content

Commit 61bfdd5

Browse files
committed
[ehealth] fix metric and ehealth name
1 parent dc933f3 commit 61bfdd5

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

examples/biomedical/cblue/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 数据集介绍
1212

13-
本项目使用了中文医学语言理解测评([Chinese Biomedical Language Understanding Evaluation,CBLUE](https://github.com/CBLUEbenchmark/CBLUE))数据集,[<sup>[1]</sup>](#refer-anchor-cblue)其包括医学文本信息抽取(实体识别、关系抽取)、医学术语归一化、医学文本分类、医学句子关系判定和医学问答共5大类任务8个子任务。
13+
本项目使用了中文医学语言理解测评([Chinese Biomedical Language Understanding Evaluation,CBLUE](https://github.com/CBLUEbenchmark/CBLUE))数据集,其包括医学文本信息抽取(实体识别、关系抽取)、医学术语归一化、医学文本分类、医学句子关系判定和医学问答共5大类任务8个子任务。
1414

1515
* CMeEE:中文医学命名实体识别
1616
* CMeIE:中文医学文本实体关系抽取
@@ -81,5 +81,4 @@ $ python -m paddle.distributed.launch --gpus "0,1,2,3" train.py --dataset CHIP-C
8181
pip install xlrd==1.2.0
8282
```
8383

84-
<div id="refer-anchor-cblue"></div>
85-
- [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)
84+
[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)

examples/biomedical/cblue/train_classification.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import paddlenlp as ppnlp
2727
from paddlenlp.data import Stack, Tuple, Pad
2828
from paddlenlp.datasets import load_dataset
29-
from paddlenlp.transformers import LinearDecayWithWarmup
29+
from paddlenlp.transformers import ElectraForSequenceClassification, LinearDecayWithWarmup
3030
from paddlenlp.metrics import MultiLabelsMetric, AccuracyAndF1
3131
from paddlenlp.ops.optimizer import ExponentialMovingAverage
3232

@@ -143,13 +143,13 @@ def do_train():
143143
train_ds, dev_ds, test_ds = load_dataset(
144144
'cblue', args.dataset, splits=['train', 'dev', 'test'])
145145

146-
model = ppnlp.transformers.ElectraForSequenceClassification.from_pretrained(
147-
'chinese-ehealth',
146+
model = ElectraForSequenceClassification.from_pretrained(
147+
'ehealth-chinese',
148148
num_classes=len(train_ds.label_list),
149149
activation='tanh',
150150
layer_norm_eps=1e-5)
151151
tokenizer = ppnlp.transformers.ElectraTokenizer.from_pretrained(
152-
'chinese-ehealth')
152+
'ehealth-chinese')
153153

154154
trans_func = partial(
155155
convert_example,

paddlenlp/transformers/electra/modeling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class ElectraPretrainedModel(PretrainedModel):
226226
"type_vocab_size": 2,
227227
"vocab_size": 21128
228228
},
229-
"chinese-ehealth": {
229+
"ehealth-chinese": {
230230
"attention_probs_dropout_prob": 0.1,
231231
"embedding_size": 768,
232232
"hidden_act": "gelu",
@@ -255,8 +255,8 @@ class ElectraPretrainedModel(PretrainedModel):
255255
"https://bj.bcebos.com/paddlenlp/models/transformers/chinese-electra-small/chinese-electra-small.pdparams",
256256
"chinese-electra-base":
257257
"https://bj.bcebos.com/paddlenlp/models/transformers/chinese-electra-base/chinese-electra-base.pdparams",
258-
"chinese-ehealth":
259-
"https://paddlenlp.bj.bcebos.com/models/transformers/chinese-ehealth.pdparams"
258+
"ehealth-chinese":
259+
"https://paddlenlp.bj.bcebos.com/models/transformers/ehealth_chinese/ehealth-chinese.pdparams"
260260
}
261261
}
262262

paddlenlp/transformers/electra/tokenizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class ElectraTokenizer(PretrainedTokenizer):
8080
"http://bj.bcebos.com/paddlenlp/models/transformers/chinese-electra-base/vocab.txt",
8181
"chinese-electra-small":
8282
"http://bj.bcebos.com/paddlenlp/models/transformers/chinese-electra-small/vocab.txt",
83-
"chinese-ehealth":
84-
"https://paddlenlp.bj.bcebos.com/models/transformers/chinese_ehealth/vocab.txt"
83+
"ehealth-chinese":
84+
"https://paddlenlp.bj.bcebos.com/models/transformers/ehealth_chinese/vocab.txt"
8585
}
8686
}
8787
pretrained_init_configuration = {
@@ -100,7 +100,7 @@ class ElectraTokenizer(PretrainedTokenizer):
100100
"chinese-electra-small": {
101101
"do_lower_case": True
102102
},
103-
"chinese-ehealth": {
103+
"ehealth-chinese": {
104104
"do_lower_case": True
105105
}
106106
}

0 commit comments

Comments
 (0)