autoliuweijie / K-BERT

Source code of K-BERT (AAAI2020)
https://ojs.aaai.org//index.php/AAAI/article/view/5681
949 stars 212 forks source link

book_review数据集复现效果不佳 #43

Closed NovemberSun closed 3 years ago

NovemberSun commented 3 years ago

您好,感谢您开源代码,我使用您的代码和您分享的book_review数据集进行试验,但是准确率只有79%,比您的结果低了快10个百分点。想问问您有没有什么建议呢? 我的运行指令为:nohup python3 -u run_kbert_cls.py --train_path /data/book_review/train.tsv --dev_path /data/book_review/dev.tsv --test_path /data/book_review/test.tsv --epochs_num 5 --batch_size 32 --kg_name CnDbpedia --output_model_path ./outputs/kbert_bookreview_CnDbpedia.bin > ./outputs/kbert_bookreview_CnDbpedia.log & (谷歌预训练模型和词表等文件路径我在程序中指定,max_length是默认的256) 我的结果为:79% image

autoliuweijie commented 3 years ago

从你的指令和结果来看,你漏了加载预训练模型参数:--pretrained_model_path ./models/google_model.bin

完整指令如下:

CUDA_VISIBLE_DEVICES='0' nohup python3 -u run_kbert_cls.py \ --pretrained_model_path ./models/google_model.bin \ --config_path ./models/google_config.json \ --vocab_path ./models/google_vocab.txt \ --train_path ./datasets/book_review/train.tsv \ --dev_path ./datasets/book_review/dev.tsv \ --test_path ./datasets/book_review/test.tsv \ --epochs_num 5 --batch_size 32 --kg_name CnDbpedia \ --output_model_path ./outputs/kbert_bookreview_CnDbpedia.bin \

./outputs/kbert_bookreview_CnDbpedia.log &

NovemberSun commented 3 years ago

是的,谢谢!