code: def load_wn18rr(
      check_md5hash=False, clean_unseen=True, add_reciprocal_rels=False
  ):
      """Load the WN18RR dataset.
  
      The dataset is described in :cite:`DettmersMS018`.
  
       .. warning:: *WN18RR*'s validation set contains 198 unseen entities over 210 triples. The test set
          has 209 unseen entities, distributed over 210 triples.
  
      The WN18RR 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`: 86,835 triples
      - `valid`: 3,034 triples
      - `test`: 3,134 triples
  
      ========= ========= ======= ======= ============ ===========
       Dataset  Train     Valid   Test    Entities     Relations
      ========= ========= ======= ======= ============ ===========
      WN18RR    86,835    3,034   3,134   40,943        11
      ========= ========= ======= ======= ============ ===========
  
      Parameters
      ----------
      clean_unseen: bool
          If `True`, filters triples in validation and test sets that include entities not present in the training set.
  
      check_md5hash: bool
          If `True` check the md5hash of the datset files (default: `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`).
  
      Returns
      -------
  
      splits: dict
          The dataset splits: `{'train': train, 'valid': valid, 'test': test}`. Each split is a ndarray of shape (n, 3).
  
      Example
      -------
  
      >>> from ampligraph.datasets import load_wn18rr
      >>> X = load_wn18rr()
      >>> X["valid"][0]
      array(['02174461', '_hypernym', '02176268'], dtype=object)
  
      """
  
      wn18rr = DatasetMetadata(
          dataset_name="wn18RR",
          filename="wn18RR.zip",
          url="https://s3-eu-west-1.amazonaws.com/ampligraph/datasets/wn18RR.zip",
          train_name="train.txt",
          valid_name="valid.txt",
          test_name="test.txt",
          train_checksum="35e81af3ae233327c52a87f23b30ad3c",
          valid_checksum="74a2ee9eca9a8d31f1a7d4d95b5e0887",
          test_checksum="2b45ba1ba436b9d4ff27f1d3511224c9",
      )
  
      if clean_unseen:
          return _clean_data(
              _load_dataset(
                  wn18rr,
                  data_home=None,
                  check_md5hash=check_md5hash,
                  add_reciprocal_rels=add_reciprocal_rels,
              )
          )
      else:
          return _load_dataset(
              wn18rr,
              data_home=None,
              check_md5hash=check_md5hash,
              add_reciprocal_rels=add_reciprocal_rels,
          )
  
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 12 for calling a global function with example usage: load_wn18rr(check_md5hash, clean_unseen, add_reciprocal_rels) and returns: _clean_data, _load_dataset