KGCP: trained KGE models

The trained knowledge graph embedding (KGE) models of the conformal prediction experiments of CP4KGE (kgcp), a library that turns the scores of a KGE model into answer sets that contain the true answer with a chosen probability (e.g. 90%), and the predicted confidence of a triple of an uncertain knowledge graph into an interval that contains the true confidence with that probability.

Models Datasets Seeds Checkpoints Folder Size
DistMult, ComplEx, RESCAL Nations, UMLS, Kinship 1–5 45 models/<dataset>-<model>/ 31 MB
UKGE (two outputs), PASSLEAF, BEUrRE CN15k, NL27k, PPI5k 0–4 60 models/unkgcp/<dataset>-<model>/ 843 MB

All are LibKGE packaged models, which kgcp.LibKGE loads.

Papers

kgcp implements the methods of three papers, and these are the models of its experiments with them:

The 45 link prediction models were trained for kgcp; the 60 uncertain-KG models are those of the UnKGCP paper.

Link prediction models: DistMult, ComplEx, RESCAL

45 models: DistMult, ComplEx and RESCAL on the Nations, UMLS and Kinship benchmarks, 5 seeds each. Each configuration was tuned per dataset with the protocol of LibKGE's authors (Ruffinelli et al., ICLR 2020), adapted to small graphs. The models were trained with LibKGE, patched for recent PyTorch and Apple Silicon.

models/<dataset>-<model>/
  config.yaml           LibKGE configuration; seed<N>.pt was trained with
                        kge start config.yaml --random_seed.default <N>
  seed1.pt … seed5.pt   LibKGE packaged models: weights, configuration, entity/relation ids

Uncertain-KG models: UKGE, PASSLEAF, BEUrRE

60 models that predict the confidence in [0, 1] of a triple of an uncertain knowledge graph: the models of UnKGCP (Zhu, Wu et al., EMNLP 2025) on CN15k (ConceptNet), NL27k (NELL) and PPI5k (STRING), seeds 0–4.

Folder Method Original checkpoints
<dataset>-ukge_logi UKGE (Chen et al., AAAI 2019), logistic output TensorFlow 1
<dataset>-ukge_rect UKGE, bounded rectifier output TensorFlow 1
<dataset>-passleaf PASSLEAF (Chen et al., AAAI 2021): UKGE trained with a pool of pseudo-labeled samples TensorFlow 1
<dataset>-beurre BEUrRE (Chen et al., NAACL 2021): probabilistic box embeddings pickled PyTorch modules
models/unkgcp/<dataset>-<model>/
  config.yaml           LibKGE configuration of the model (the models only score:
                        there is no training code for them in LibKGE)
  seed0.pt … seed4.pt   LibKGE packaged models: weights, configuration, entity/relation ids
models/unkgcp/verify-<dataset>.md   test errors of the converted models and of the paper

These files are conversions, not new trainings. The UnKGCP authors trained the models with the original code of UKGE and PASSLEAF (TensorFlow 1) and of BEUrRE (PyTorch). The checkpoints of their first five runs were converted into LibKGE models by third_party/unkge of CP4KGE, which implements the three scorers as LibKGE models. Each file records the original files it was converted from, with their sizes and SHA-256 checksums (checkpoint["source"]).

Verification. Every converted UKGE and PASSLEAF model reproduces UKGE's formula on the original arrays (differences of at most 2.4e-7, in float32), and every converted BEUrRE model gives exactly the confidences of BEUrRE's code. The test errors of the converted models are in models/unkgcp/verify-<dataset>.md: 17 of the 18 values of the paper's Table 2 agree to its rounding (the other, the MSE of UKGE on PPI5k, is 0.004999 against the paper's 0.01).

Download

Into the folder models/ of a clone of CP4KGE, where it is git-ignored. Keep --include: without it, this model card overwrites the README of the clone.

# the 45 link prediction models (31 MB)
uvx --from huggingface_hub hf download Yuqicheng/KGCP-KGE-Checkpoints \
    --include "models/*" --exclude "models/unkgcp/*" --local-dir .

# the 60 uncertain-KG models (843 MB)
uvx --from huggingface_hub hf download Yuqicheng/KGCP-KGE-Checkpoints \
    --include "models/unkgcp/*" --local-dir .

Use

The models hold the ids of entities and relations, but not the triples: they need their dataset, prepared by the scripts of CP4KGE.

import kgcp

# answer sets (after: uv run scripts/download_data.py umls)
model = kgcp.LibKGE("models/umls-distmult/seed1.pt")
queries = kgcp.Queries.from_triples(model.kg.split("test"))
scores = kgcp.nonconformity(model, queries, kgcp.Softmax(), known=model.kg.known("train", "valid"))
cal, test = scores.split(0.5)
sets = kgcp.SplitConformal(alpha=0.1).calibrate(cal).predict(test)

# intervals (after: uv run python third_party/unkge/download.py data
#                   uv run python third_party/unkge/prepare_data.py)
model = kgcp.LibKGE("models/unkgcp/nl27k-beurre/seed0.pt")
residuals = kgcp.residuals(model, model.kg.uncertain_triples("test"), kgcp.EntropyResidual())
cal, test = residuals.split(0.5)
intervals = kgcp.SplitConformal(alpha=0.1).calibrate(cal).predict(test)

The README of CP4KGE has the installation, the results of all models and their reproduction.

Sources and licenses

The code of CP4KGE and the 45 link prediction models are released under the MIT License. The 60 uncertain-KG models were trained by the authors of UnKGCP and are redistributed here in converted form.

Every file holds the names of the entities and relations of its dataset, which stay under the terms of their sources: Nations, UMLS and Kinship (Kok and Domingos, 2007); NL27k (NELL), CN15k (ConceptNet, CC BY-SA 4.0) and PPI5k (STRING, CC BY 4.0), as released with UKGE.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support