Skip to content
forked from pykeen/pykeen

πŸ€– A Python library for learning and evaluating knowledge graph embeddings

License

Notifications You must be signed in to change notification settings

feldnerd/pykeen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

074afec Β· Sep 9, 2019
Sep 6, 2019
Sep 9, 2019
Sep 8, 2019
Sep 8, 2019
Jul 23, 2019
Aug 9, 2019
May 14, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 7, 2019
Sep 8, 2019
Sep 8, 2019
Apr 25, 2019
Sep 7, 2019

Repository files navigation

PyKEEN

Travis CI License

PyKEEN (Python KnowlEdge EmbeddiNgs) is a Python package designed to train and evaluate knowledge graph embedding models (incorporating multi-modal information). It is part of the KEEN Universe.

Installation β€’ Quickstart β€’ Models β€’ Data Sets β€’ Support

Installation

The development version of PyKEEN (POEM) can be downloaded and installed from GitHub on Python 3.7+ with:

$ git clone https://github.com/mali-git/POEM_develop.git poem
$ cd poem
$ pip install -e .

Quickstart

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 open world assumption and evaluates with rank-based evaluation.

from poem.pipeline import pipeline
result = pipeline(
    model='TransE',
    data_set='nations',
)

The results are returned in a dataclass that has attributes for the trained model, the training loop, and the evaluation.

POEM is extensible such that:

  • Each model has the same API, so anything from poem.models can be dropped in
  • Each training loop has the same API, so poem.training.CWATrainingLoop can be dropped in
  • Triples factories can be generated by the user with from poem.triples.TriplesFactory

Implementation

Models

Name Reference Citation
1 ComplEx poem.models.ComplEx Trouillon et al., 2016
2 ComplExLiteralCWA poem.models.ComplExLiteralCWA Agustinus et al., 2018
3 ConvE poem.models.ConvE Dettmers et al., 2018
4 ConvKB poem.models.ConvKB Nguyen et al., 2018
5 DistMult poem.models.DistMult Yang et al., 2014
6 DistMultLiteral poem.models.DistMultLiteral Agustinus et al., 2018
7 ERMLP poem.models.ERMLP Dong et al., 2014
8 HolE poem.models.HolE Nickel et al., 2016
9 KG2E poem.models.KG2E He et al., 2015
10 NTN poem.models.NTN Socher et al., 2013
11 ProjE poem.models.ProjE Shi et al., 2017
12 RESCAL poem.models.RESCAL Nickel et al., 2011
13 RotatE poem.models.RotatE Sun et al., 2019
14 SimplE poem.models.SimplE Kazemi et al., 2018
15 StructuredEmbedding poem.models.StructuredEmbedding Bordes et al., 2011
16 TransD poem.models.TransD Ji et al., 2015
17 TransE poem.models.TransE Bordes et al., 2013
18 TransH poem.models.TransH Wang et al., 2014
19 TransR poem.models.TransR Lin et al., 2015
20 TuckEr poem.models.TuckEr Balazevic et al., 2019
21 UnstructuredModel poem.models.UnstructuredModel Bordes et al., 2014

Data Sets

Name Reference Description
1 fb15k poem.datasets.fb15k The FB15k data set.
2 fb15k237 poem.datasets.fb15k237 The FB15k-237 data set.
3 kinship poem.datasets.kinship The Kinship data set.
4 nations poem.datasets.nations The Nations data set.
5 umls poem.datasets.umls The UMLS data set.
6 wn18 poem.datasets.wn18 The WN18 data set.
7 wn18rr poem.datasets.wn18rr The WN18-RR data set.
8 yago310 poem.datasets.yago310 The YAGO3-10 data set is a subset of YAGO3 that only contains entities with at least 10 relations.

Training Modes

Name Reference Description
1 cwa poem.training.CWATrainingLoop A training loop that uses the closed world assumption.
2 owa poem.training.OWATrainingLoop A training loop that uses the open world assumption.

Evaluators

Name Reference Description
1 rankbased poem.evaluators.RankBasedEvaluator A rank-based evaluator for KGE models.

Metrics

Name Reference Description
1 metric poem.evaluators.MetricResults Results from computing metrics.

Supporters

This project has been supported by several organizations:

About

πŸ€– A Python library for learning and evaluating knowledge graph embeddings

Resources

License

Code of conduct

Citation

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 79.7%
  • Jupyter Notebook 20.3%