code: def _create_vocab(self):
      assert (
          self.split == "train"
      ), "Vocablurary can only be created for training file."
  
      with open(self.raw_data_path, "r") as file:
          text = file.read()
          sentences = sent_tokenize(text)
  
      occ_register = OrderedCounter()
      w2i = dict()
      i2w = dict()
  
      special_tokens = ["<exc>", "<pad>", "<eos>"]
      for st in special_tokens:
          i2w[len(w2i)] = st
          w2i[st] = len(w2i)
  
      texts = []
      unq_words = []
  
      for i, line in enumerate(sentences):
          words = word_tokenize(line)
          occ_register.update(words)
          texts.append(words)
  
      for w, occ in occ_register.items():
          if occ > self.min_occ and w not in special_tokens:
              i2w[len(w2i)] = w
              w2i[w] = len(w2i)
          else:
              unq_words.append(w)
  
      assert len(w2i) == len(i2w)
  
      print(
          "Vocablurary of {} keys created, {} words are excluded (occurrence <= {}).".format(
              len(w2i), len(unq_words), self.min_occ
          )
      )
  
      vocab = dict(w2i=w2i, i2w=i2w)
      with io.open(
          os.path.join(self.gen_dir, self.vocab_file), "wb"
      ) as vocab_file:
          data = json.dumps(vocab, ensure_ascii=False)
          vocab_file.write(data.encode("utf8", "replace"))
  
      with open(
          os.path.join(self.gen_dir, "cub.unique"), "wb"
      ) as unq_file:
          pickle.dump(np.array(unq_words), unq_file)
  
      with open(os.path.join(self.gen_dir, "cub.all"), "wb") as a_file:
          pickle.dump(occ_register, a_file)
  
      self._load_vocab()
  
imports: import io
  import json
  import os
  import pickle
  from collections import Counter, OrderedDict
  from collections import defaultdict
  import numpy
  import torch
  import torch.nn
  from nltk.tokenize import sent_tokenize, word_tokenize
  from torch.utils.data import Dataset
  from torchvision import transforms, models, datasets
label_desc: Use image node_id 13 for calling the CUBSentences obj's underlying member method code with example usage: obj._create_vocab() without return types