Model card: the library is CP4KGE, the repository is Yuqicheng/CP4KGE-models, prediction sets
Browse files16 unmodified lines17181920212223242526276 unmodified lines343536373839404142434445464748495051525355 unmodified lines1091101111121131141151161171181195 unmodified lines12512612712812913013116 unmodified lines- beurre---# KGCP: trained KGE modelsThe 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 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 itsexperiments with them:- **KGCP**, answer 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.,[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 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 \--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 .```5 unmodified lines```pythonimport 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"))16 unmodified lines17181920212223242526276 unmodified lines343536373839404142434445464748495051525355 unmodified lines1091101111121131141151161171181195 unmodified lines12512612712812913013116 unmodified lines- beurre---# CP4KGE: trained KGE modelsThe trained knowledge graph embedding (KGE) models of the conformal predictionexperiments 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## PapersCP4KGE implements the methods of three papers, and these are the models of itsexperiments with them:- **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**, 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 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/CP4KGE-models \--include "models/*" --exclude "models/unkgcp/*" --local-dir .# the 60 uncertain-KG models (843 MB)uvx --from huggingface_hub hf download Yuqicheng/CP4KGE-models \--include "models/unkgcp/*" --local-dir .```5 unmodified lines```pythonimport kgcp# 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