class_docstr: Abstract class for dialog problems.
code: def generate_data(self, data_dir, tmp_dir, task_id=-1):
      self.data_dir = data_dir
      # Determine whether we are in training or validation mode.
      self.mode = {
          problem.DatasetSplit.TRAIN: "train",
          problem.DatasetSplit.EVAL: "dev",
          problem.DatasetSplit.TEST: "test",
      }
      filepath_fns = {
          problem.DatasetSplit.TRAIN: self.training_filepaths,
          problem.DatasetSplit.EVAL: self.dev_filepaths,
          problem.DatasetSplit.TEST: self.test_filepaths,
      }
  
      split_paths = [
          (
              split["split"],
              filepath_fns[split["split"]](
                  data_dir,
                  split["shards"],
                  shuffled=self.already_shuffled,
              ),
          )
          for split in self.dataset_splits
      ]
      all_paths = []
      for _, paths in split_paths:
          all_paths.extend(paths)
  
      if self.is_generate_per_split:
          for split, paths in split_paths:
              # Create the source and target txt files from the raw data.
              self.preprocess_data(self.mode[split])
              generator_utils.generate_files(
                  self.generate_encoded_samples(
                      data_dir, tmp_dir, split
                  ),
                  paths,
              )
      else:
          self.preprocess_data(self.mode[problem.DatasetSplit.TRAIN])
          generator_utils.generate_files(
              self.generate_encoded_samples(
                  data_dir, tmp_dir, problem.DatasetSplit.TRAIN
              ),
              all_paths,
          )
  
      generator_utils.shuffle_dataset(
          all_paths, extra_fn=self._pack_fn()
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import tarfile
  import zipfile
  import requests
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators.text_problems import VocabType
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 30 for calling the DialogAbstract obj's underlying member method code with example usage: obj.generate_data(data_dir, tmp_dir, task_id) without return types