Expand description
Temporal knowledge graphs: quads (head, relation, tail, timestamp).
Facts in an event KG (ICEWS-style) carry a discrete timestamp. This
module loads quad datasets, defines the TemporalScorer trait (the
temporal counterpart of Scorer, same lower-is-better
energy convention), provides the TComplEx CPU scorer (Lacroix,
Obozinski, Usunier, ICLR 2020: ComplEx with a complex timestamp
embedding multiplied into the relation), and evaluates temporal link
prediction in the time-aware filtered setting.
Training lives in burn_temporal (feature
burn-ndarray or burn-wgpu); the CLI subcommand is
tranz train-temporal.
Structs§
- QuadIds
- One interned quad:
(head, relation, tail, time)as dense ids. - TCompl
Ex - TComplEx (Lacroix et al., ICLR 2020):
-Re(<h, r ∘ w_τ, conj(t)>). - Temporal
Dataset - An interned temporal dataset: vocabularies plus train/valid/test quads.
- Temporal
Filter Index - Time-aware filter index: known tails of
(h, r, τ)and known heads of(r, t, τ), over all splits.
Traits§
- Temporal
Scorer - Trait for scoring temporal quads. Same convention as
Scorer: lower values indicate more likely quads.
Functions§
- evaluate_
temporal_ link_ prediction - Evaluate temporal link prediction in the time-aware filtered setting.
- load_
temporal_ dataset - Load a temporal dataset from a directory with
train.txt,valid.txt,test.txt, each linehead \t relation \t tail \t timestamp.