thunlp / OpenKE

An Open-Source Package for Knowledge Embedding (KE)
3.83k stars 985 forks source link

triple classification problem #350

Closed XuMayi closed 2 years ago

XuMayi commented 2 years ago

Input Files Path : ./benchmarks/FB15K237/ The toolkit is importing datasets. The total of relations is 237. The total of entities is 14541. The total of train triples is 272115. Input Files Path : ./benchmarks/FB15K237/ The total of test triples is 20466. The total of valid triples is 17535. Finish initializing... Epoch 9 | loss: 6.593310: 100%|█████████████████| 10/10 [00:21<00:00, 2.18s/it] 0%| | 1/20466 [00:00<04:40, 72.97it/s]

Process finished with exit code 0

执行tester.run_triple_classification()进行测试时,tqdm显示存在问题。TestDataLoader中,在进行triple classification任务时,TestDataSampler只采样一次,返回一组positive sample和一组negative sample,因此run_triple_classification中的第一个for循环在计算score时也只执行一次,感觉这个for循环不是很有必要。

实际运行中acc和threshold已经出来了,但是最后没输出。

另外,函数"run_triple_classification()"和"get_best_threshlod()"里的threshlod拼写也有一点点小错误。:)

LiuYuemei111 commented 2 years ago

谢谢您的建议