code: def read_words(self, min_count):
      word_frequency = dict()
      for line in open(self.inputFileName, encoding="ISO-8859-1"):
          line = line.split()
          if len(line) > 1:
              self.sentences_count += 1
              for word in line:
                  if len(word) > 0:
                      self.token_count += 1
                      word_frequency[word] = (
                          word_frequency.get(word, 0) + 1
                      )
  
                      if self.token_count % 1000000 == 0:
                          print(
                              "Read "
                              + str(int(self.token_count / 1000000))
                              + "M words."
                          )
  
      wid = 0
      for w, c in word_frequency.items():
          if c < min_count:
              continue
          self.word2id[w] = wid
          self.id2word[wid] = w
          self.word_frequency[wid] = c
          wid += 1
  
      self.word_count = len(self.word2id)
      print("Total embeddings: " + str(len(self.word2id)))
  
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 2 for calling the DataReader obj's underlying member method code with example usage: obj.read_words(min_count) without return types