PyKEEN Logo PyKEEN (Python KnowlEdge EmbeddiNgs) is a Python package designed to train and evaluate knowledge graph embedding models (incorporating multi-modal information)

Getting Started

Installation

The development version of PyKEEN can be downloaded and installed from PyPI on Python 3.7+ with:

pip install pykeen

The source code can be found on GitHub for installation in development mode with:

$ git clone https://github.com/pykeen/pykeen
$ cd pykeen
$ pip install -e .

Training Wheels

This example shows how to train a model on a data set and test on another data set.

The fastest way to get up and running is to use the 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 on the Nations dataset. By default, the training loop uses the stochastic local closed world assumption and evaluates with rank-based evaluation.

from pykeen.pipeline import pipeline
pipeline_result = pipeline(
     model='TransE',
     dataset='nations',
)
hits_at_10 = pipeline_result.metric_results.get_metric('hits@10')

Full documentation can be found on ReadTheDocs.

Applications

Below we highlight recent theoretical and applied uses of PyKEEN.

Benchmarking Study

FB15k237 Summary

We’ve run an unprecedented large benchmarking study. This image describes the results on the FB15k237 dataset across several knowledge graph embedding models, loss functions, training approaches, and usages of explicit modeling of inverse triples. This is just one of several datasets analyzed in this study. In our manuscript, we also assess the reproducibility of old models’ best reported hyperparameters.

Code Data Paper

Metaresearch Recommendations

Metaresearch Schema

We used PyKEEN to train a scholarly recommendations system to suggest papers to read, grants to apply to, and collaborations to make.

Code Paper

Pathway Crosstalk Analysis

Pathway Crosstalk Schema

We used PyKEEN to train a pathway crosstalk analysis platform that identifies which biological pathways are connected, giving further insight into normal human pathophysiology and potentially leading to novel hypotheses for understanding the aetiology of complex disease leading to novel drug discovery.

Code Paper