code: def _create_dataset_generators(self, summarizer):
      data_rank = 3 if isinstance(summarizer, BertSummarizer) else 2
      train_gen = DatasetGenerator(
          batch_size=self.batch_size,
          shuffle_buffer_size=self.shuffle_buffer_size,
          rank=data_rank,
      )
      val_gen = DatasetGenerator(
          batch_size=self.batch_size,
          shuffle_buffer_size=None,
          rank=data_rank,
      )
      return train_gen, val_gen
  
imports: import datetime
  import logging
  import os
  import tempfile
  from collections import Counter
  from typing import Tuple, List, Iterable, Callable, Dict, Union
  import tensorflow
  import yaml
  from headliner.callbacks.evaluation_callback import EvaluationCallback
  from headliner.callbacks.model_checkpoint_callback import ModelCheckpointCallback
  from headliner.callbacks.tensorboard_callback import TensorboardCallback
  from headliner.callbacks.validation_callback import ValidationCallback
  from headliner.embeddings import read_embedding, embedding_to_matrix
  from headliner.evaluation.scorer import Scorer
  from headliner.losses import masked_crossentropy
  from headliner.model.bert_summarizer import BertSummarizer
  from headliner.model.summarizer import Summarizer
  from headliner.preprocessing.bucket_generator import BucketGenerator
  from headliner.preprocessing.dataset_generator import DatasetGenerator
  from headliner.preprocessing.keras_tokenizer import KerasTokenizer
  from headliner.preprocessing.preprocessor import Preprocessor
  from headliner.preprocessing.vectorizer import Vectorizer
  from headliner.utils.logger import get_logger
label_desc: Use image node_id 7 for calling the Trainer obj's underlying member method code with example usage: obj._create_dataset_generators(summarizer) and returns: train_gen,  val_gen