code: def process_dataset(path):
      """Maps entities and relations to ids and saves corresponding pickle arrays.
  
      Args:
        path: Path to dataset directory.
  
      Returns:
        examples: Dictionary mapping splits to with Numpy array contatining
                  corresponding KG triples.
        filters: Dictionary containing filters for lhs and rhs predictions.
      """
      ent2idx, rel2idx = get_idx(dataset_path)
      examples = {}
      splits = ["train", "valid", "test"]
      for split in splits:
          dataset_file = os.path.join(path, split)
          examples[split] = to_np_array(dataset_file, ent2idx, rel2idx)
      all_examples = np.concatenate(
          [examples[split] for split in splits], axis=0
      )
      lhs_skip, rhs_skip = get_filters(all_examples, len(rel2idx))
      filters = {"lhs": lhs_skip, "rhs": rhs_skip}
      return examples, filters
  
file_path: neural-structured-learning/research/kg_hyp_emb/datasets/process.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import pickle
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: process_dataset(path) and returns: examples,  filters