实验介绍
实验数据信息
- 实验数据来源:github
- 实验任务:情感分析,二分类任务
- 训练集大小:9600
- 验证集大小:1200
- 测试集大小:1200
- 样本均衡情况:均衡
- 参与对比的Bert系列模型包括:Bert、Finbert、Roberta
实验数据选型
- 文本长度
- 最小长度:4
- 最大长度:1992
- 平均长度:108
Bert
python run_classifier.py --task_name=emlo --do_train=true --do_eval=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/chine
se_L-12_H-768_A-12/vocab.txt --bert_config_file=./uncased/chinese_L-12_H-768_A-12/bert_config.json --init_checkpoint=./uncased/chinese_L-12_H-768_A-12/bert_model.ckpt --max_seq_length=64 --train_batch_size=16 --learning_rate=2e-5 --num_train_epochs=3.0 --output_dir=./tmp/bert_out/
python run_classifier.py --task_name=emlo --do_predict=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/chinese_L-12_H-768_A-12/vocab.txt --bert_config_file=./uncased/chinese_L-12_H-768_A-12/bert_config.json --init_checkpoint=./tmp/bert_out/ --max_seq_length=64 --output_dir=./tmp/bert_emotion/
Finbert
python run_classifier.py --task_name=emlo --do_train=true --do_eval=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/FinBERT_L-12_H-768_A-12_tf/vocab.txt --bert_config_file=./uncased/FinBERT_L-12_H-768_A-12_tf/bert_config.json --init_checkpoint=./uncased/FinBERT_L-12_H-768_A-12_tf/bert_model.ckpt --max_seq_length=64 --train_batch_size=16 --learning_rate=2e-5 --num_train_epochs=3.0 --output_dir=./tmp/finbert_out/
python run_classifier.py --task_name=emlo --do_predict=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/FinBERT_L-12_H-768_A-12_tf/vocab.txt --bert_config_file=./uncased/FinBERT_L-12_H-768_A-12_tf/bert_config.json --init_checkpoint=./tmp/finbert_out/ --max_seq_length=64 --output_dir=./tmp/finbert_emotion/
Roberta
python run_classifier.py --task_name=emlo --do_train=true --do_eval=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/roberta_zh_l12/vocab.txt --bert_config_file=./uncased/roberta_zh_l12/bert_config.json --init_checkpoint=./uncased/roberta_zh_l12/bert_model.ckpt --max_seq_length=64 --train_batch_size=16 --learning_rate=2e-5 --num_train_epochs=3.0 --output_dir=./tmp/roberta_out/
python run_classifier.py --task_name=emlo --do_predict=true --data_dir=./ChnSentiCorp_data --vocab_file=./uncased/roberta_zh_l12/vocab.txt --bert_config_file=./uncased/roberta_zh_l12/bert_config.json --init_checkpoint=./tmp/roberta_out/ --max_seq_length=64 --output_dir=./tmp/roberta_emotion/
实验效果对比
Bert | P | R | F1 |
---|
negative | 0.9324 | 0.9324 | 0.9324 |
postive | 0.9342 | 0.9342 | 0.9342 |
total | 0.9333 | 0.9333 | 0.9333 |
Finbert | P | R | F1 |
---|
negative | 0.9254 | 0.9645 | 0.9445 |
postive | 0.9639 | 0.9243 | 0.9437 |
total | 0.9441 | 0.9441 | 0.9441 |
Roberta | P | R | F1 |
---|
negative | 0.9206 | 0.9408 | 0.9306 |
postive | 0.9411 | 0.9210 | 0.9310 |
total | 0.9308 | 0.9308 | 0.9308 |