class_docstr: Implementation of Dataset class
  
  This is a simple implementation of loading and processing dataset for metapath2vec 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","metapath2vec","model",".","Args",":","config",":","dict",",","some","configure","parameters","."]
docstr: Get a table for negative sampling
          
docstr_tok: ["Get","a","table","for","negative","sampling"]
code: def initNegatives(self):
      """Get a table for negative sampling"""
      pow_freq = np.array(list(self.word2freq.values())) ** 0.75
      words_pow = sum(pow_freq)
      ratio = pow_freq / words_pow
      count = np.round(ratio * Dataset.NEGATIVE_TABLE_SIZE)
      for wid, c in enumerate(count):
          self.negatives += [wid] * int(c)
      self.negatives = np.array(self.negatives)
      np.random.shuffle(self.negatives)
      self.sampling_prob = ratio
  
file_path: PGL/legacy/examples/metapath2vec/Dataset.py
imports: import sys
  import os
  import glob
  import numpy
  import tqdm
  import time
  import logging
  import random
  from pgl import heter_graph
  import pickle
label_desc: Use image node_id 4 for calling the Dataset obj's underlying member method code with example usage: obj.initNegatives() without return types