thu-coai / KdConv

KdConv: A Chinese Multi-domain Dialogue Dataset Towards Multi-turn Knowledge-driven Conversation
Apache License 2.0
459 stars 62 forks source link

论文中有写测试时的PPL值,在测试代码中找不到PPL值 #11

Closed jiaweimmiao closed 3 years ago

jiaweimmiao commented 3 years ago

首先很感谢作者公开的代码以及数据集,仔细拜读了您的论文,本人十分受启迪,再次谢谢您~ 但是在复现作者代码时出现些小问题,HRED模型训练后,在测试时,困惑度(PPL)指标值并没有找到代码实现部分,看到了Blue值,distinct值实现部分,并能得到其具体值。 本人有两个问题: 1)论文中提到的PPL是指验证时,在验证数据集得到结果值,还是在测试数据集上得到。 2)如果是在测试时得到,困惑度指标值代码可以公开嘛? 恳请您的回复,谢谢!

chujiezheng commented 3 years ago

可以参考这里

jiaweimmiao commented 3 years ago

十分感谢老师,刚刚怕您GitHub上看不到,正在给您写邮件刚写到一半,没想到这么晚还回复我。我现在试一试。那论文中PPL值是在测试集进行测试得到的吧?

------------------ 原始邮件 ------------------ 发件人: "Chujie Zheng"<notifications@github.com>; 发送时间: 2021年1月6日(星期三) 晚上10:15 收件人: "thu-coai/KdConv"<KdConv@noreply.github.com>; 抄送: "幸福就好"<455605116@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [thu-coai/KdConv] 论文中有写测试时的PPL值,在测试代码中找不到PPL值 (#11)

可以参考这里

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chujiezheng commented 3 years ago

是的,代码里有写清楚,可以参考这里

jiaweimmiao commented 3 years ago

老师您是说这块代码实现了PPL嘛?

------------------ 原始邮件 ------------------ 发件人: "Chujie Zheng"<notifications@github.com>; 发送时间: 2021年1月6日(星期三) 晚上10:12 收件人: "thu-coai/KdConv"<KdConv@noreply.github.com>; 抄送: "幸福就好"<455605116@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [thu-coai/KdConv] 论文中有写测试时的PPL值,在测试代码中找不到PPL值 (#11)

ppl利用了cotk包中的实现,我们的代码在这里导入:myCoTK/dataloader/single_turn_dialog.py 中line 12的PerplexityMetric

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chujiezheng commented 3 years ago

jiaweimmiao commented 3 years ago

老师您在回复中指出的那个链接里是有关于PPL实现的页面,PPL主要是通过下面代码实现吧? 但这块代码 print(' perplexity on %s set: %.2f' % (key_name, np.exp(loss))) print(loss) return loss 是在evaluate函数中写的,那意味着得到的PPL是验证集而非测试集的啊。

------------------ 原始邮件 ------------------ 发件人: "Chujie Zheng"<notifications@github.com>; 发送时间: 2021年1月6日(星期三) 晚上10:49 收件人: "thu-coai/KdConv"<KdConv@noreply.github.com>; 抄送: "幸福就好"<455605116@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [thu-coai/KdConv] 论文中有写测试时的PPL值,在测试代码中找不到PPL值 (#11)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chujiezheng commented 3 years ago

在测试的时候,调用这个方法,然后通过metric1得到计算ppl的Metric类,通过导入测试时的模型输出,最后通过close方法计算ppl值