Model card: the library is CP4KGE, the repository is Yuqicheng/CP4KGE-models, prediction sets
Browse files16 unmodified lines17181920202122232423242526276 unmodified lines34353637373839404041424343444546474849505051525355 unmodified lines1091101111121121131141151161161171181195 unmodified lines12512612712812812913013116 unmodified lines- beurre---
# KGCP: trained KGE models# CP4KGE: trained KGE models
The trained knowledge graph embedding (KGE) models of the conformal predictionexperiments of [CP4KGE](https://github.com/ZhuYuqicheng/CP4KGE) (`kgcp`), a library thatturns the scores of a KGE model into answer sets that contain the true answer with aexperiments of [CP4KGE](https://github.com/ZhuYuqicheng/CP4KGE) (Python module `kgcp`), alibrary that turns the scores of a KGE model into prediction sets that contain the true answer with achosen probability (e.g. 90%), and the predicted confidence of a triple of an uncertainknowledge graph into an interval that contains the true confidence with that probability.
6 unmodified lines
## Papers
`kgcp` implements the methods of three papers, and these are the models of itsCP4KGE implements the methods of three papers, and these are the models of itsexperiments with them:
- **KGCP**, answer sets for link prediction: Zhu et al.,- **KGCP**, prediction sets for link prediction: Zhu et al., [Conformalized Answer Set Prediction for Knowledge Graph Embedding](https://aclanthology.org/2025.naacl-long.32/), NAACL 2025.- **CondKGCP**, answer sets with coverage per relation: Zhu et al.,- **CondKGCP**, prediction sets with coverage per relation: Zhu et al., [Predicate-Conditional Conformalized Answer Sets for Knowledge Graph Embeddings](https://aclanthology.org/2025.findings-acl.215/), Findings of ACL 2025.- **UnKGCP**, intervals for the confidences of uncertain knowledge graphs: Zhu, Wu et al., [Certainty in Uncertainty: Reasoning over Uncertain Knowledge Graphs with Statistical Guarantees](https://aclanthology.org/2025.emnlp-main.441/), EMNLP 2025.
The 45 link prediction models were trained for `kgcp`; the 60 uncertain-KG models areThe 45 link prediction models were trained for CP4KGE; the 60 uncertain-KG models arethose of the UnKGCP paper.
## Link prediction models: DistMult, ComplEx, RESCAL55 unmodified lines
```bash# the 45 link prediction models (31 MB)uvx --from huggingface_hub hf download Yuqicheng/KGCP-KGE-Checkpoints \uvx --from huggingface_hub hf download Yuqicheng/CP4KGE-models \ --include "models/*" --exclude "models/unkgcp/*" --local-dir .
# the 60 uncertain-KG models (843 MB)uvx --from huggingface_hub hf download Yuqicheng/KGCP-KGE-Checkpoints \uvx --from huggingface_hub hf download Yuqicheng/CP4KGE-models \ --include "models/unkgcp/*" --local-dir .```
5 unmodified lines```pythonimport kgcp
# answer sets (after: uv run scripts/download_data.py umls)# prediction 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"))README.md+10-10