Bert系列模型情感分析任务对比实验

实验介绍

实验数据信息

  • 实验数据来源: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/

实验效果对比

  • sentence_length= 64
BertPRF1
negative0.93240.93240.9324
postive0.93420.93420.9342
total0.93330.93330.9333
FinbertPRF1
negative0.92540.96450.9445
postive0.96390.92430.9437
total0.94410.94410.9441
RobertaPRF1
negative0.92060.94080.9306
postive0.94110.92100.9310
total0.93080.93080.9308
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值