kb-completion-eval
Learn to Explain Efficiently via Neural Logic Inductive Learning — Yang et al. (2019) (arXiv:1910.02481, 2019)
What this evaluates
Evaluates a model's ability to learn first-order logic rules for knowledge base completion and object classification. It probes rule generation efficiency, scalability to longer rules, and few-shot generalization on relational data.
Datasets
- Even-and-Successor (ES) — total ?; splits: train (-1), valid (-1), test (-1)
- FB15K-237 — total ?; splits: train (-1), valid (-1), test (-1)
- WN18 — total ?; splits: train (-1), valid (-1), test (-1)
- Visual Genome (via GQA) — total ?; splits: train (-1), test (-1)
Metrics
MRR (primary) — range: [0, 1]
- Mean Reciprocal Rank: the average of 1/rank for the correct answer across all queries.
Hits@10 — range: [0, 1]
- Fraction of queries where the correct answer is ranked in the top 10 predictions.
R@1 — range: [0, 1]
- Accuracy of predicting the correct object class label at rank 1.
R@5 — range: [0, 1]
- Accuracy of predicting the correct object class label within the top 5 predictions.
Input / output format
Input: Relational knowledge base triples (subject, relation, object) or scene-graphs; query triplets for KB completion; object-relation pairs for classification.
Output: Probability score for a fact triplet being present in the KB; predicted object class label.
Scoring recipe
def compute_metrics(predictions, gold_indices):
ranks = []
for pred, gold in zip(predictions, gold_indices):
sorted_indices = np.argsort(-pred)
rank = np.where(sorted_indices == gold)[0][0] + 1
ranks.append(rank)
mrr = np.mean(1.0 / ranks)
hits10 = np.mean([r <= 10 for r in ranks])
r1 = np.mean([r == 1 for r in ranks])
r5 = np.mean([r <= 5 for r in ranks])
return mrr, hits10, r1, r5
Common pitfalls
- The Even-and-Successor benchmark is noise-free, so the paper only reports wall-clock time for it rather than accuracy scores.
- The Visual Genome dataset is highly noisy; the authors use a pre-processed GQA version and filter predicates with fewer than 1500 occurrences, which alters the original data distribution.
Evidence (verbatim from paper)
We use Mean Reciprocal Ranks (MRR) and Hits@10 for evaluation metrics (see AppendixC for details). Quantitatively, we evaluate the learned rules on predicting the object class labels on a held-out set in terms of their R@1 and R@5.
Citation
@misc{yang2019learn,
title={Learn to Explain Efficiently via Neural Logic Inductive Learning},
author={Yang et al. (2019)},
year={2019},
note={arXiv:1910.02481}
}
1---2name: kb-completion-eval3description: Evaluates a model's ability to learn first-order logic rules for knowledge base completion and object classification. It probes rule generation efficiency, scalability to longer rules, and few-shot generalization on relational data. Use when the user wants to benchmark on Even-and-Successor (ES), FB15K-237, WN18, Visual Genome (via GQA), or asks about evaluating this task. Reports MRR.4---56# kb-completion-eval78> Learn to Explain Efficiently via Neural Logic Inductive Learning — Yang et al. (2019) (arXiv:1910.02481, 2019)910## What this evaluates1112Evaluates a model's ability to learn first-order logic rules for knowledge base completion and object classification. It probes rule generation efficiency, scalability to longer rules, and few-shot generalization on relational data.1314## Datasets1516- **Even-and-Successor (ES)** — total ?; splits: train (-1), valid (-1), test (-1)17- **FB15K-237** — total ?; splits: train (-1), valid (-1), test (-1)18- **WN18** — total ?; splits: train (-1), valid (-1), test (-1)19- **Visual Genome (via GQA)** — total ?; splits: train (-1), test (-1)2021## Metrics2223- `MRR` **(primary)** — range: [0, 1]24 - Mean Reciprocal Rank: the average of 1/rank for the correct answer across all queries.25- `Hits@10` — range: [0, 1]26 - Fraction of queries where the correct answer is ranked in the top 10 predictions.27- `R@1` — range: [0, 1]28 - Accuracy of predicting the correct object class label at rank 1.29- `R@5` — range: [0, 1]30 - Accuracy of predicting the correct object class label within the top 5 predictions.3132## Input / output format3334**Input**: Relational knowledge base triples (subject, relation, object) or scene-graphs; query triplets for KB completion; object-relation pairs for classification.3536**Output**: Probability score for a fact triplet being present in the KB; predicted object class label.3738## Scoring recipe3940```python41def compute_metrics(predictions, gold_indices):42 ranks = []43 for pred, gold in zip(predictions, gold_indices):44 sorted_indices = np.argsort(-pred)45 rank = np.where(sorted_indices == gold)[0][0] + 146 ranks.append(rank)47 mrr = np.mean(1.0 / ranks)48 hits10 = np.mean([r <= 10 for r in ranks])49 r1 = np.mean([r == 1 for r in ranks])50 r5 = np.mean([r <= 5 for r in ranks])51 return mrr, hits10, r1, r552```5354## Common pitfalls5556- The Even-and-Successor benchmark is noise-free, so the paper only reports wall-clock time for it rather than accuracy scores.57- The Visual Genome dataset is highly noisy; the authors use a pre-processed GQA version and filter predicates with fewer than 1500 occurrences, which alters the original data distribution.5859## Evidence (verbatim from paper)6061> We use Mean Reciprocal Ranks (MRR) and Hits@10 for evaluation metrics (see Appendix[C](#A3 "Appendix C Experiments ‣ Learn to Explain Efficiently via Neural Logic Inductive Learning") for details). Quantitatively, we evaluate the learned rules on predicting the object class labels on a held-out set in terms of their R@1 and R@5.6263## Citation6465```bibtex66@misc{yang2019learn,67 title={Learn to Explain Efficiently via Neural Logic Inductive Learning},68 author={Yang et al. (2019)},69 year={2019},70 note={arXiv:1910.02481}71}72```7374- arXiv: 1910.02481