ibalazevic / TuckER

TuckER: Tensor Factorization for Knowledge Graph Completion
MIT License
350 stars 60 forks source link

You add reverse relation to the training data? #3

Closed cheungdaven closed 5 years ago

cheungdaven commented 5 years ago

Reverse relation is usually removed from datasets, but you add it to training data? What is the motivation for this?

ibalazevic commented 5 years ago

We train and test the model using 1-N scoring which is why we insert reciprocal relations, the same way as in Dettmers et al., 2018 (code) (reciprocal relations are also used by Lacroix et al., 2018 (code)): for each relation, we create an inverse by appending "_reverse" to the relation name. However, we train and test each triple only in one direction, always predicting the tail, i.e. (e_1, r, ?) and (e_2, r_reverse, ?), which is equivalent to not having reciprocal relations and predicting both head and tail.

This is different from having reciprocal relations in your training and test set, because in that case for each of them you would predict both head and tail, which would lead to an easier task and higher accuracy.

I hope this answers your question.