PyKEEN is a Python package for reproducible, facile knowledge graph embeddings.

The fastest way to get up and running is to use the pykeen.pipeline.pipeline() function.

It provides a high-level entry into the extensible functionality of this package. The following example shows how to train and evaluate the TransE model (pykeen.models.TransE) on the Nations dataset (pykeen.datasets.Nations) by referring to them by name. By default, the training loop uses the stochastic closed world assumption training approach ( and evaluates with rank-based evaluation (pykeen.evaluation.RankBasedEvaluator).

>>> from pykeen.pipeline import pipeline
>>> result = pipeline(
...     model='TransE',
...     dataset='Nations',
... )

The results are returned in a pykeen.pipeline.PipelineResult instance, which has attributes for the trained model, the training loop, and the evaluation.


Indices and Tables