docstr: split: 'trainval' or 'test' 
docstr_tok: ["split",":","'trainval","'","or","'test","'"]
code: def __init__(self, root_data_dir, split, transform=None, **kwargs):
      """split: 'trainval' or 'test'"""
  
      super().__init__()
      self.data_dir = os.path.join(root_data_dir, "cub")
      self.split = split
      self.max_sequence_length = kwargs.get("max_sequence_length", 32)
      self.min_occ = kwargs.get("min_occ", 3)
      self.transform = transform
      os.makedirs(
          os.path.join(root_data_dir, "lang_emb"), exist_ok=True
      )
  
      self.gen_dir = os.path.join(
          self.data_dir,
          "oc:{}_msl:{}".format(self.min_occ, self.max_sequence_length),
      )
  
      if split == "train":
          self.raw_data_path = os.path.join(
              self.data_dir, "text_trainvalclasses.txt"
          )
      elif split == "test":
          self.raw_data_path = os.path.join(
              self.data_dir, "text_testclasses.txt"
          )
      else:
          raise Exception("Only train or test split is available")
  
      os.makedirs(self.gen_dir, exist_ok=True)
      self.data_file = "cub.{}.s{}".format(
          split, self.max_sequence_length
      )
      self.vocab_file = "cub.vocab"
  
      if not os.path.exists(os.path.join(self.gen_dir, self.data_file)):
          print(
              "Data file not found for {} split at {}. Creating new... (this may take a while)".format(
                  split.upper(),
                  os.path.join(self.gen_dir, self.data_file),
              )
          )
          self._create_data()
  
      else:
          self._load_data()
  
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 1 to create a new CUBSentences object from inherited base classes: Dataset with example: obj = CUBSentences(root_data_dir, split, transform)