class_docstr: load the FB15K
docstr: Map function for negative sampling.
  :param train_triple_positive: the triple positive.
  :return: the positive and negative triples.
code: def training_data_map(self, train_triple_positive):
      """
      Map function for negative sampling.
      :param train_triple_positive: the triple positive.
      :return: the positive and negative triples.
      """
      size = len(train_triple_positive)
      train_triple_negative = []
      for i in range(size):
          corrupt_head_prob = np.random.binomial(1, 0.5)
          head_neg = train_triple_positive[i][0]
          relation = train_triple_positive[i][1]
          tail_neg = train_triple_positive[i][2]
          for j in range(0, self._neg_times):
              sample = train_triple_positive[i] + 0
              while True:
                  rand_id = np.random.randint(self.entity_total)
                  if corrupt_head_prob:
                      if (
                          rand_id,
                          relation,
                          tail_neg,
                      ) not in self.training_triple_pool:
                          sample[0] = rand_id
                          train_triple_negative.append(sample)
                          break
                  else:
                      if (
                          head_neg,
                          relation,
                          rand_id,
                      ) not in self.training_triple_pool:
                          sample[2] = rand_id
                          train_triple_negative.append(sample)
                          break
      train_triple_positive = np.expand_dims(
          train_triple_positive, axis=2
      )
      train_triple_negative = np.expand_dims(
          train_triple_negative, axis=2
      )
      if self._neg_mode:
          return (
              train_triple_positive,
              train_triple_negative,
              np.array([corrupt_head_prob], dtype="float32"),
          )
      return train_triple_positive, train_triple_negative
  
file_path: PGL/legacy/examples/pgl-ke/data_loader.py
imports: import os
  import numpy
  from collections import defaultdict
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling the KGLoader obj's underlying member method code with example usage: obj.training_data_map(train_triple_positive) and returns: train_triple_positive,  train_triple_negative, train_triple_positive,  train_triple_negative,  np