torch_geometric.datasets.FB15k_237

class FB15k_237(root: str, split: str = 'train', transform: Optional[Callable] = None, pre_transform: Optional[Callable] = None, force_reload: bool = False)[source]

Bases: InMemoryDataset

The FB15K237 dataset from the “Translating Embeddings for Modeling Multi-Relational Data” paper, containing 14,541 entities, 237 relations and 310,116 fact triples.

Note

The original FB15k dataset suffers from major test leakage through inverse relations, where a large number of test triples could be obtained by inverting triples in the training set. In order to create a dataset without this characteristic, the FB15k_237 describes a subset of FB15k where inverse relations are removed.

Parameters:
  • root (str) – Root directory where the dataset should be saved.

  • split (str, optional) – If "train", loads the training dataset. If "val", loads the validation dataset. If "test", loads the test dataset. (default: "train")

  • transform (callable, optional) – A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before every access. (default: None)

  • pre_transform (callable, optional) – A function/transform that takes in an torch_geometric.data.Data object and returns a transformed version. The data object will be transformed before being saved to disk. (default: None)

  • force_reload (bool, optional) – Whether to re-process the dataset. (default: False)