code: def load_fb13(
      check_md5hash=False, clean_unseen=True, add_reciprocal_rels=False
  ):
      """Load the Freebase13 (FB13) dataset.
  
      FB13 is a subset of Freebase :cite:`bollacker2008freebase`
      and was initially presented in
      `Reasoning With Neural Tensor Networks for Knowledge Base Completion` :cite:`socher2013reasoning`.
  
      .. note::
          FB13 also provide true and negative labels for the triples in the validation and tests sets.
          The positive base rate is close to 50%.
  
      FB13 dataset is loaded from file if it exists at the ``AMPLIGRAPH_DATA_HOME`` location.
      If ``AMPLIGRAPH_DATA_HOME`` is not set, 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``.
  
      This dataset is divided in three splits:
  
      - `train`: 316232 triples
      - `valid`: 11816 triples
      - `test`: 47464 triples
  
      Both the validation and test splits are associated with labels (binary ndarrays),
      with `True` for positive statements and `False` for  negatives:
  
      - `valid_labels`
      - `test_labels`
  
      ========= ========= ========== ========== ======== ======== ============ ===========
       Dataset  Train     Valid Pos  Valid Neg  Test Pos Test Neg Entities     Relations
      ========= ========= ========== ========== ======== ======== ============ ===========
      FB13      316232    5908       5908       23733    23731    75043        13
      ========= ========= ========== ========== ======== ======== ============ ===========
  
      Parameters
      ----------
      check_md5hash: bool
          If `True` check the md5hash of the files (default: `False`).
  
      clean_unseen: bool
          If `True`, filters triples in validation and test sets that include entities not present in the training set.
  
      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).
  
      Returns
      -------
  
      splits: dict
          The dataset splits: {'train': train, 'valid': valid, 'valid_labels': valid_labels,
          'test': test, 'test_labels': test_labels}.
          Each split containing a dataset is a ndarray of shape (n, 3).
          The labels are ndarray of shape (n).
  
      Example
      -------
  
      >>> from ampligraph.datasets import load_fb13
      >>> X = load_fb13()
      >>> X["valid"][0]
      array(['cornelie_van_zanten', 'gender', 'female'], dtype=object)
      >>> X["valid_labels"][0:3]
      array([True, False, True], dtype=object)
  
      """
      fb13 = DatasetMetadata(
          dataset_name="freebase13",
          filename="freebase13.zip",
          url="https://s3-eu-west-1.amazonaws.com/ampligraph/datasets/freebase13.zip",
          train_name="train.txt",
          valid_name="dev.txt",
          test_name="test.txt",
          train_checksum="9099ebcd85ab3ce723cfaaf34f74dceb",
          valid_checksum="c4ef7b244baa436a97c2a5e57d4ba7ed",
          test_checksum="f9af2eac7c5a86996c909bdffd295528",
      )
  
      dataset = _load_dataset(
          fb13,
          data_home=None,
          check_md5hash=check_md5hash,
          add_reciprocal_rels=add_reciprocal_rels,
      )
  
      valid_labels = dataset["valid"][:, 3]
      test_labels = dataset["test"][:, 3]
  
      dataset["valid"] = dataset["valid"][:, 0:3]
      dataset["test"] = dataset["test"][:, 0:3]
  
      dataset["valid_labels"] = valid_labels == "1"
      dataset["test_labels"] = test_labels == "1"
  
      if clean_unseen:
          clean_dataset, valid_idx, test_idx = _clean_data(
              dataset, return_idx=True
          )
          clean_dataset["valid_labels"] = dataset["valid_labels"][
              valid_idx
          ]
          clean_dataset["test_labels"] = dataset["test_labels"][
              test_idx
          ]
          return clean_dataset
      else:
          return dataset
  
imports: import hashlib
  import json
  import logging
  import os
  import urllib
  import zipfile
  from collections import namedtuple
  from pathlib import Path
  import numpy
  import pandas
label_desc: Use image node_id 17 for calling a global function with example usage: load_fb13(check_md5hash, clean_unseen, add_reciprocal_rels) and returns: clean_dataset, dataset