code: def initTableNegatives(self):
      # get a table for negative sampling, if word with index 2 appears twice, then 2 will be listed
      # in the table twice.
      pow_frequency = (
          np.array(list(self.word_frequency.values())) ** 0.75
      )
      words_pow = sum(pow_frequency)
      ratio = pow_frequency / words_pow
      count = np.round(ratio * DataReader.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: dgl/examples/pytorch/metapath2vec/reading_data.py
imports: import numpy
  import torch
  from download import AminerDataset
  from torch.utils.data import Dataset
label_desc: Use image node_id 4 for calling the DataReader obj's underlying member method code with example usage: obj.initTableNegatives() without return types