SimKGC icon indicating copy to clipboard operation
SimKGC copied to clipboard

Question about the mask in code

Open handsomelys opened this issue 2 years ago • 2 comments

I would like to ask, what do triplet masks and other masks in the code do? Looking forward to your answer!

handsomelys avatar Jan 25 '23 08:01 handsomelys

As said in the paper:

During training, there may exist some false negatives. 
For example, the correct entity happens to appear in another triple within the same batch. 
We filter out such entities with a binary mask.

If a <h, r, t> triple is true according to the training data, we do not consider t as a negative. We use a mask to implement this mechanism.

intfloat avatar Jan 25 '23 10:01 intfloat

thanks!

handsomelys avatar Jan 27 '23 10:01 handsomelys