class_docstr: Class for generating a dictionary of all words in the PTB corpus
class_docstr_tok: ["Class","for","generating","a","dictionary","of","all","words","in","the","PTB","corpus"]
docstr: Populate the corpus with words from train, test and valid splits of data
  Returns:
      None
docstr_tok: ["Populate","the","corpus","with","words","from","train",",","test","and","valid","splits","of","data","Returns",":","None"]
code: def load_dictionary(self):
      """
      Populate the corpus with words from train, test and valid splits of data
      Returns:
          None
      """
      for split_type in ["train", "test", "valid"]:
          path = os.path.join(
              self.data_dir,
              FILENAME[self.dataset],
              FILES[self.dataset](split_type),
          )
          # Add words to the dictionary
          with open(path, "r") as fp:
              tokens = 0
              for line in fp:
                  words = ["<sos>"] + line.split() + ["<eos>"]
                  tokens += len(words)
                  for word in words:
                      self.add_word(word)
  
file_path: nlp-architect/nlp_architect/data/ptb.py
imports: import os
  import sys
  import numpy
  import urllib.request
label_desc: Use image node_id 3 for calling the PTBDictionary obj's underlying member method code with example usage: obj.load_dictionary() without return types