Skip to content

Commit 3fdb1fd

Browse files
author
tianxin
authored
Fix tiny bug (#740)
* add FewCLUE 9 datasets * fix a bug for tnews
1 parent a96c61f commit 3fdb1fd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

examples/few_shot/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Few-Shot Learning 旨在研究如何从少量有监督的训练样本中学习
1111
| 算法 | 预训练模型 | Score | eprstmt | bustm | ocnli | csldcp | tnews | cluewsc | iflytek | csl | chid |
1212
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |------------ | ------------ | ---------- |
1313
| P-tuning | ERNIE1.0 | 55.70 | 83.28 | 63.43 | 35.36 | 60.54 | 50.02 | 54.51 | 50.14 | 54.93 | 41.16 |
14-
| EFL | ERNIE1.0 | 54.47 | 84.10 | 60.10 | 35.12 | 56.61 | 57.31 | 53.59 | 46.37 | 61.21 | 43.16 |
14+
| EFL | ERNIE1.0 | 54.47 | 84.10 | 60.10 | 35.12 | 56.61 | 56.57 | 53.59 | 46.37 | 61.21 | 36.56 |
1515

1616
## 策略库
1717
- [P-tuning](./p-tuning)

examples/few_shot/efl/data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,9 @@ def _create_examples(self, datasets, phase, task_label_description):
199199
"""Creates examples for the training and dev sets."""
200200

201201
examples = []
202-
203202
if phase == "train":
204203
for example in datasets:
205-
true_label = example["label"]
204+
true_label = str(example["label"])
206205
neg_examples = []
207206
for label, label_description in task_label_description.items():
208207
new_example = dict()

examples/few_shot/efl/train.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def parse_args():
104104
parser.add_argument(
105105
'--save_steps',
106106
type=int,
107-
default=10000,
107+
default=100000,
108108
help="Inteval steps to save checkpoint")
109109
return parser.parse_args()
110110

@@ -276,4 +276,4 @@ def do_train():
276276

277277
if __name__ == "__main__":
278278
args = parse_args()
279-
do_train()
279+
do_train()

0 commit comments

Comments
 (0)