mana-ysh / knowledge-graph-embeddings

Implementations of Embedding-based methods for Knowledge Base Completion tasks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hits metrics are all zero

sdx0112 opened this issue · comments

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

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.