code: def _create_data(self):
      if self.split == "train" and not os.path.exists(
          os.path.join(self.gen_dir, self.vocab_file)
      ):
          self._create_vocab()
      else:
          self._load_vocab()
  
      with open(self.raw_data_path, "r") as file:
          text = file.read()
          sentences = sent_tokenize(text)
  
      data = defaultdict(dict)
      pad_count = 0
  
      for i, line in enumerate(sentences):
          words = word_tokenize(line)
  
          tok = words[: self.max_sequence_length - 1]
          tok = tok + ["<eos>"]
          length = len(tok)
          if self.max_sequence_length > length:
              tok.extend(
                  ["<pad>"] * (self.max_sequence_length - length)
              )
              pad_count += 1
          idx = [self.w2i.get(w, self.w2i["<exc>"]) for w in tok]
  
          id = len(data)
          data[id]["tok"] = tok
          data[id]["idx"] = idx
          data[id]["length"] = length
  
      print(
          "{} out of {} sentences are truncated with max sentence length {}.".format(
              len(sentences) - pad_count,
              len(sentences),
              self.max_sequence_length,
          )
      )
      with io.open(
          os.path.join(self.gen_dir, self.data_file), "wb"
      ) as data_file:
          data = json.dumps(data, ensure_ascii=False)
          data_file.write(data.encode("utf8", "replace"))
  
      self._load_data(vocab=False)
  
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 12 for calling the CUBSentences obj's underlying member method code with example usage: obj._create_data() without return types