thunlp/OpenKE

预测结果和指标计算问题

xiaocheng99 opened this issue · 0 comments

预测的指标hit@10为 0.5 , 但是我将预测出来的结果全部打印出来,然后自己写了套算法计算hit@10 只有0.003
再进行对比发现 , 预测的结果中 和 test结果 hit@10命中的只有一组数据。
关于预测结果的提取 ,我是在Tester类中的run_link_prediction函数中,根据 score = self.test_one_step(data_head)中的score大小顺序对data_head和data_tail中 的bach数组进行排序得到的,具体如下写法;

score = self.test_one_step(data_head) # 使用zip()函数将分数和实体组合成一个元组的列表 combined_head = list(zip(score, data_head['batch_h'])) # 根据分数对列表进行降序排序 combined_head.sort(reverse=True) top_50_entities = [entity for score, entity in combined_head[:50]]

请问哪里除了问题呢?