Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于ConvE模型性能的问题 #13

Closed
FujiwaraKeine opened this issue Sep 9, 2022 · 1 comment
Closed

关于ConvE模型性能的问题 #13

FujiwaraKeine opened this issue Sep 9, 2022 · 1 comment

Comments

@FujiwaraKeine
Copy link

使用自带的ConvE模型的配置文件训练模型时,在FB15K237和WN18RR两个数据集上,MRR、Hits@n等各项评价指标都达不到文档中给出的结果,例如在Hits@10只有0.29左右,远低于文档中的0.50。我想知道模型性能偏低的这种情况是由我自己的问题导致的,还是因为代码本身的问题导致的。

@Modberge
Copy link
Collaborator

Modberge commented Sep 9, 2022

您好,我们已经注意到了这个问题。经过验证发现当前版本的ConvE模型在执行链接预测任务的代码存在问题,目前已经修复了这个bug,而修复后的实验结果与文档中给出的结果相近。

具体来说,因为ConvE仅能对尾实体进行预测,而无法预测头实体。因此在预测之前,我们将数据集中所有三元组进行了反向扩充,即对于每个三元组(h,r,t)生成反向三元组(t, -r ,h)。(-r为r的反向关系) 这样就使得扩充数据集仅预测尾实体的结果与原数据集的预测结果等价。但是在之前的代码中,并未更改预测模式,使得结果降低。

您现在可以从源码安装NeuralKG,或者仅将ConvELitModel代码的39和53行中
ranks = link_predict(batch, self.model, prediction='all')
改为
ranks = link_predict(batch, self.model, prediction='tail')
就可以达到与说明文档相近的实验结果。

非常感谢您对NeuralKG提供的帮助。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants