code: def get_dataset(cache_dir, tokenizer_name, tokenizer_dir, max_length):
      train_dataset, test_dataset = load_dataset(
          "imdb", split=["train", "test"], cache_dir=cache_dir
      )
      tokenizer = get_tokenizer(tokenizer_name, tokenizer_dir)
      train_texts, train_labels = (
          train_dataset["text"],
          train_dataset["label"],
      )
      test_texts, test_labels = (
          test_dataset["text"],
          test_dataset["label"],
      )
      train_dataset = TransformerDataset(
          train_texts, train_labels, tokenizer, max_length
      )
      test_dataset = TransformerDataset(
          test_texts, test_labels, tokenizer, max_length
      )
      return train_dataset, test_dataset
  
file_path: ignite/examples/transformers/utils.py
imports: import torch
  from dataset import TransformerDataset
  from datasets import load_dataset
  from model import TransformerModel
  from transformers import AutoTokenizer
  from ignite.handlers import DiskSaver
label_desc: Use image node_id 3 for calling a global function with example usage: get_dataset(cache_dir, tokenizer_name, tokenizer_dir, max_length) and returns: train_dataset,  test_dataset