ampligraph.datasets.load_fb15k(check_md5hash=False, add_reciprocal_rels=False)

Load the FB15k dataset


The dataset includes a large number of inverse relations that spilled to the test set, and its use in experiments has been deprecated. Use FB15k-237 instead.

FB15k is a split of Freebase, first proposed by [BUGD+13].

The FB15k dataset is loaded from file if it exists at the AMPLIGRAPH_DATA_HOME location. If AMPLIGRAPH_DATA_HOME is not set the the default ~/ampligraph_datasets is checked.

If the dataset is not found at either location it is downloaded and placed in AMPLIGRAPH_DATA_HOME or ~/ampligraph_datasets.

The dataset is divided in three splits:

  • train
  • valid
  • test
Dataset Train Valid Test Entities Relations
FB15K 483,142 50,000 59,071 14,951 1,345
  • check_md5hash (boolean) – If True check the md5hash of the files. Defaults to False.
  • add_reciprocal_rels (bool) – Flag which specifies whether to add reciprocal relations. For every <s, p, o> in the dataset this creates a corresponding triple with reciprocal relation <o, p_reciprocal, s>. (default: False).

splits – The dataset splits: {‘train’: train, ‘valid’: valid, ‘test’: test}. Each split is an ndarray of shape [n, 3].

Return type:



>>> from ampligraph.datasets import load_fb15k
>>> X = load_fb15k()
>>> X['test'][:3]
       ['/m/040db', '/base/activism/activist/area_of_activism', '/m/0148d'],
        '/m/05lf_']], dtype=object)