ERNIE icon indicating copy to clipboard operation
ERNIE copied to clipboard

想使用ERNIE\applications\tasks\text_matching示例程序+ernie_3.0_base_ch预训练模型,比较两个文本相似度得分,有问题吗?

Open lbz0920 opened this issue 3 years ago • 3 comments

1.使用哪个数据集训练合适,想使用lcqmc数据集,但lcqmc数据集的train.tsv第3列是lable 0,1,text_matching代码要求第3列neg_title列,这样训练是不是有问题?需要修改ERNIE\applications\tasks\text_matching代码吗?需要把lcqmc数据集test.tsv第3列的lable0,1转化为随机的neg_title列吗,需要修改哪些文件?

2.若lcqmc数据集不适合,使用哪个模型+数据集适合得出文本的相似度得分,求推荐?

lbz0920 avatar Jul 11 '22 05:07 lbz0920

文本匹配分两大类型,pointwise和pairewise:

  • piarewise的数据集,第3列是neg_title文本,对应运行python run_trainer.py --param_path ./examples/mtch_ernie_pairwise_simnet_ch.json
  • pointwise的数据集,第3列是0,1标签,对应运行:python run_trainer.py --param_path ./examples/mtch_ernie_fc_pointwise_ch.json 或者python run_trainer.py --param_path ./examples/mtch_ernie_pointwise_simnet_ch.json

pointwise的数据集方式与lcqmc数据集一样,你可以参考下 mtch_ernie_fc_pointwise_ch.json或者mtch_ernie_pointwise_simnet_ch.json 配置文件里面对应的数据集demo

webYFDT avatar Jul 12 '22 09:07 webYFDT

想求文本相似度得分:run_infer.py+mtch_ernie_pairwise_simnet_ch_infer.json可以使用pointwise训练出的模型吗? 以下3个到底使用哪个模型合适? ErnieMatchingFcPointwise(ernie_matching_fc_pointwise) ErnieMatchingSiamesePairwise(ernie_matching_siamese_pairwise.py) ErnieMatchingSiamesePointwise(ernie_matching_siamese_pointwise.py) python run_trainer.py --param_path ./examples/mtch_ernie_pointwise_simnet_ch.json:pointwise训练出的模型,是不是输出0,1,没法输出像pairwise的语义相似概率,没法求出相似度得分,pairwise预测文本相似度得分时使用pointwise训练的模型有问题吧?pairwise预测时必须使用pairwise训练的模型?

lbz0920 avatar Jul 14 '22 05:07 lbz0920

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen it. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 18:09 stale[bot]