uma-pi1 / kge

LibKGE - A knowledge graph embedding library for reproducible research
MIT License
765 stars 124 forks source link

Relation Prediction #266

Closed SRL94 closed 1 year ago

SRL94 commented 2 years ago

Hi,

After training the model, can I use the trained model to predict relation? That is, given a subject-object pair (s, o), the trained model predicts the relation r. Is it "score_so()"?

Best regards Sirui

SRL94 commented 2 years ago

I got this issue when using "score_so()" for ConvE: "The reciprocal relations model cannot score relations". How can I fix it? Thank you.

rufex2001 commented 2 years ago

You can't use the reciprocal relations model for predicting relations, as these models have two embeddings for each relation, each with different semantics, So, it's unclear which of the two to use when predicting relations. There are works on this, but as far as I understand there is no principled way to do this and we currently don't support this. I suggest you turn off the use of reciprocal relations when training your model.

On Mon, 12 Sept 2022 at 06:30, Sirui @.***> wrote:

I got this issue when using "score_so()": "The reciprocal relations model cannot score relations".

— Reply to this email directly, view it on GitHub https://github.com/uma-pi1/kge/issues/266#issuecomment-1243207003, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEWXZH46QQ3257BRFI6ARDV52WWPANCNFSM6AAAAAAQKCHNMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

SRL94 commented 2 years ago

Thank you for the reply. I tired to turn off the use of reciprocal relations when training ConvE but it does not work.

rgemulla commented 2 years ago

Yes, ConvE requires reciprocal relations.

rufex2001 commented 1 year ago

ConvE is a model that requires the use of reciprocal relations. Thus, it must use them even to predict relations, meaning one must decide (and implement) a way to combine the reciprocal relation embeddings for such queries. Most other models don't have this requirement.

Sirui @.***> schrieb am Di., 13. Sept. 2022, 04:52:

Thank you for the reply. I tired to turn off the use of reciprocal relations when training ConvE but it does not work.

— Reply to this email directly, view it on GitHub https://github.com/uma-pi1/kge/issues/266#issuecomment-1244829996, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEWXZAUJH6MMFA5AUHKNG3V57T7TANCNFSM6AAAAAAQKCHNMA . You are receiving this because you commented.Message ID: @.***>