class_docstr: Implementation of Dataset class
  
  This is a simple implementation of loading and processing dataset for GATNE model.
  
  Args:
      config: dict, some configure parameters.
class_docstr_tok: ["Implementation","of","Dataset","class","This","is","a","simple","implementation","of","loading","and","processing","dataset","for","GATNE","model",".","Args",":","config",":","dict",",","some","configure","parameters","."]
docstr: Generate word pairs for training.
          
docstr_tok: ["Generate","word","pairs","for","training","."]
code: def generate_pairs(self, all_walks):
      """Generate word pairs for training."""
      logging.info(
          ["edge_types before generate pairs", self.edge_types]
      )
  
      pairs = []
      skip_window = self.config["win_size"] // 2
      for layer_id, e_type in enumerate(self.edge_types):
          walks = all_walks[e_type]
          for walk in tqdm.tqdm(walks):
              for i in range(len(walk)):
                  for j in range(1, skip_window + 1):
                      if i - j >= 0 and walk[i] != walk[i - j]:
                          neg_nodes = self.graph[e_type].sample_nodes(
                              self.config["neg_num"]
                          )
                          pairs.append(
                              (
                                  walk[i],
                                  walk[i - j],
                                  *neg_nodes,
                                  layer_id,
                              )
                          )
                      if i + j < len(walk) and walk[i] != walk[i + j]:
                          neg_nodes = self.graph[e_type].sample_nodes(
                              self.config["neg_num"]
                          )
                          pairs.append(
                              (
                                  walk[i],
                                  walk[i + j],
                                  *neg_nodes,
                                  layer_id,
                              )
                          )
      return pairs
  
file_path: PGL/legacy/examples/GATNE/Dataset.py
imports: import sys
  import os
  import tqdm
  import numpy
  import logging
  import random
  from pgl import heter_graph
  import pickle
label_desc: Use image node_id 8 for calling the Dataset obj's underlying member method code with example usage: obj.generate_pairs(all_walks) and returns: pairs