class_docstr: Knowledge Graph dataset class.
docstr: Get examples in a split.
  
  Args:
    split: String indicating the split to use (train/valid/test).
  
  Returns:
    examples: tf.data.Dataset contatining KG triples in a split.
docstr_tok: ["Get","examples","in","a","split",".","Args",":","split",":","String","indicating","the","split","to","use","(","train\/valid\/test",")",".","Returns",":","examples",":","tf.data.Dataset","contatining","KG","triples","in","a","split","."]
code: def get_examples(self, split):
      """Get examples in a split.
  
      Args:
        split: String indicating the split to use (train/valid/test).
  
      Returns:
        examples: tf.data.Dataset contatining KG triples in a split.
      """
      examples = self.data[split]
      if split == "train":
          copy = np.copy(examples)
          tmp = np.copy(copy[:, 0])
          copy[:, 0] = copy[:, 2]
          copy[:, 2] = tmp
          copy[:, 1] += self.n_predicates // 2
          examples = np.vstack((examples, copy))
      if self.debug:
          examples = examples[:1000]
          examples = examples.astype(np.int64)
      tf_dataset = tf.data.Dataset.from_tensor_slices(examples)
      if split == "train":
          buffer_size = examples.shape[0]
          tf_dataset.shuffle(
              buffer_size=buffer_size, reshuffle_each_iteration=True
          )
      return tf_dataset
  
file_path: neural-structured-learning/research/kg_hyp_emb/datasets/datasets.py
imports: import os
  import pickle
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling the DatasetFn obj's underlying member method code with example usage: obj.get_examples(split) and returns: tf_dataset