How tsafavi/codex works
CoDEx is a knowledge-graph completion benchmark: users load a dataset and its metadata, inspect positive and hard-negative triples, or evaluate pretrained models for link prediction and triple classification. The Python API reads the packaged files; evaluation scripts use LibKGE checkpoints and produce metrics. The README also documents a notebook for exploring the data and a command-line pretrained-model downloader. Source excerpts establish the API’s file reads and downloader’s file writes; evaluation and notebook relationships are documented in the README, not verified from their implementation.
Main entry points: codex.py CoDEx API · scripts Link prediction · tc.py Triple classification · baseline.py Frequency baseline
Components 20
Benchmark data
- Positive triples
data/triples - Hard negatives
data/triples - Entity metadata
data/entities - Relation metadata
data/relations - Entity types
data/types - Wikipedia extracts
data/entities - Type extracts
data/types
Data access
- CoDEx API
codex/codex.py - Python package
codex/__init__.py
Evaluation
- Link prediction
scripts - Triple classification
scripts/tc.py - Frequency baseline
scripts/baseline.py - Evaluation results
Models and exploration
- Data notebook
Explore CoDEx.ipynb - Link prediction configs
models/link-prediction - Classification configs
models/triple-classification - Pretrained checkpoints
models - Model downloader
download_pretrained.py
Other components
- Researcher
- LibKGE
Connections 25
- Researcher → CoDEx API: loads dataset
README.md - CoDEx API → Positive triples: reads splits
codex/codex.py - CoDEx API → Hard negatives: reads negatives
codex/codex.py - CoDEx API → Entity metadata: reads entities
codex/codex.py - CoDEx API → Relation metadata: reads relations
codex/codex.py - CoDEx API → Entity types: reads types
codex/codex.py - CoDEx API → Wikipedia extracts: reads extracts
codex/codex.py - CoDEx API → Type extracts: reads extracts
codex/codex.py - Researcher → Data notebook: explores data
README.md - Researcher → Link prediction: runs evaluation
README.md - Link prediction → LibKGE: uses framework
README.md - Link prediction → Link prediction configs: uses configs
README.md - Link prediction → Pretrained checkpoints: loads models
README.md - Link prediction → Evaluation results: reports metrics
README.md - Researcher → Triple classification: runs evaluation
README.md - Triple classification → LibKGE: loads models
scripts/tc.py - Triple classification → Classification configs: uses configs
README.md - Triple classification → Hard negatives: loads hard negatives
scripts/tc.py - Triple classification → Evaluation results: reports metrics
scripts/tc.py - Researcher → Frequency baseline: compares models
README.md - Frequency baseline → LibKGE: loads checkpoint
scripts/baseline.py - Frequency baseline → Evaluation results: reports rankings
scripts/baseline.py - Researcher → Model downloader: requests checkpoints
README.md - Model downloader → Pretrained checkpoints: writes checkpoints
download_pretrained.py - Model downloader → LibKGE: downloads checkpoints
README.md