mana-ysh / knowledge-graph-embeddings

Implementations of Embedding-based methods for Knowledge Base Completion tasks
Apache License 2.0
257 stars 63 forks source link

Hits metrics are all zero #10

Closed sdx0112 closed 6 years ago

sdx0112 commented 6 years ago

I am running the ComplEx model using the parameters as you suggested. When I run the test script, I got the following metrics: Hits@1:0 Hits@1(filter):0 Hits@10:0 Hits@10(filter):0 Hits@3:0 Hits@3(filter):0 MRR:0.4627 MRR(filter):0.9402

Here are my testing parameters: --ent ../dat/wordnet-mlj12/train.entlist --rel ../dat/wordnet-mlj12/train.rellist --data ../dat/wordnet-mlj12/wordnet-mlj12-test.txt --model ../logs/ComplEx.best --method complex --graphall ../dat/wordnet-mlj12/whole.txt --filtered

sdx0112 commented 6 years ago

I have found the reason. The code is running in Python2, so I need to modify the Hits metric n_corr_h1_raw/n_sample/2 to 0.5 * n_corr_h1_raw/n_sample.