intfloat / SimKGC

ACL 2022, SimKGC: Simple Contrastive Knowledge Graph Completion with Pre-trained Language Models
188 stars 36 forks source link

Questions about metrics #17

Open handsomelys opened 1 year ago

handsomelys commented 1 year ago

In the given source code, acc@k is used to evaluate the model on the valid set, and hit@k is used to evaluate the model on the test set. Are there any similarities and differences between these two metrics?

intfloat commented 1 year ago

Acc@k and Hit@k are the same metrics with different names. For both metrics, a prediction is considered correct if it is in the top-k ranked list.

The main difference in the implementation is that:

Acc@k is computed within a batch, since computing embeddings for all the entities is time-consuming.

Hit@k is computed over all candidate entities, this is the metric reported in the paper.

handsomelys commented 1 year ago

thanks