Akeepers / LEAR

The implementation our EMNLP 2021 paper "Enhanced Language Representation with Label Knowledge for Span Extraction".
113 stars 13 forks source link

关于zh_Ontonote4的复现 #4

Closed YeDeming closed 2 years ago

YeDeming commented 2 years ago

同学你好,

我根据论文,使用以下参数运行 CUDA_VISIBLE_DEVICES=0 python run_ner.py --task_type sequence_classification --task_save_name SERS --data_dir ./data/ner --data_name zh_onto4 --model_name SERS --model_name_or_path ../bert_models/chinese-roberta-wwm-ext-large --output_dir ./zh_onto4_models/bert_large --do_lower_case False --result_dir ./zh_onto4_models/results --first_label_file ./data/ner/zh_onto4/processed/label_map.json --overwrite_output_dir True --train_set ./data/ner/zh_onto4/processed/train.json --dev_set ./data/ner/zh_onto4/processed/dev.json --test_set ./data/ner/zh_onto4/processed/test.json --is_chinese True --max_seq_length 128 --per_gpu_train_batch_size 32 --gradient_accumulation_steps 1 --num_train_epochs 5 --learning_rate 8e-6 --task_layer_lr 10 --label_str_file ./data/ner/zh_onto4/processed/label_annotation.txt --span_decode_strategy v5

在Ontonote4 Chinese上得到 f1: 82.32,与论文上报告的82.95有一些差距,请问这个数值是合理的吗,还是我有运行参数设置不对?

期待您的回复! 叶德铭

Akeepers commented 2 years ago

论文的参数是我得到最佳结果的参数,我没有检查你是否保持了一致,从你的结果初步来看,算是合理。因为不同的实验环境会造成参数初始化不一致,是会有结果上的波动,我的最终结果是在3090上得到的

YeDeming commented 2 years ago

如果可以的话,可以告知你的具体运行指令吗?

Akeepers commented 2 years ago

就是论文里说的参数,没有什么区别 & batch_size 我用了梯度累积

YeDeming commented 2 years ago

主要是一些其他的参数我不太确定,是自己大概填的,比如
--span_decode_strategy v5 --label_str_file ./data/ner/zh_onto4/processed/label_annotation.txt --task_save_name SERS --model_name SERS 请问这些也是正确的吗?

Akeepers commented 2 years ago

model_name没有问题,这个确实是我整理代码没整理好,估计最近也没有时间再整理了

span_decode_strategy 对nested ,设置--exist_nested=True就好,flat就是v5

YeDeming commented 2 years ago

好的,非常感谢,我换一台机子再试试

Akeepers commented 2 years ago

此外,关于ED,注意这个 Note: The thunlp has updated the repo HMEAE recently, which causing the mismatch of data. Make sure you use the earlier version for ED task. 也是别的同学复现的时候问我才发现的

YeDeming commented 2 years ago

抱歉~ 我还有一个小问题,请问你有用--do_ema吗

Akeepers commented 2 years ago

没有,这个代码本身是我一个偏实验性repo,所以集成了很多功能,我提交的时候也没有删

ema我最早看到是阿里在一个cv任务上用的,加这个是当时是准备打一个比赛,试了下,发现结果很差,也没有投入精力继续尝试了

YeDeming commented 2 years ago

非常感谢!

Alwin4Zhang commented 1 year ago

跑了一遍,rtx3080 10G f1: 0.8245, p: 0.8345(6186/7413), r: 0.8148(6186/7592) 也没到最高,看来要多跑几次