class_docstr: Task class for NLU joint learning.
class_docstr_tok: ["Task","class","for","NLU","joint","learning","."]
docstr: Generate data for offline training.
docstr_tok: ["Generate","data","for","offline","training","."]
code: def generate_data(self):
      """Generate data for offline training."""
      if self.infer_without_label:
          column_num = 1
          text_ds = load_textline_dataset(
              self.paths_after_pre_process, column_num
          )
      else:
          column_num = 3
          (
              intent_label_ds,
              slots_label_ds,
              text_ds,
          ) = load_textline_dataset(
              self.paths_after_pre_process, column_num
          )
  
      logging.info("Loading text dataset...")
      input_pipeline_func = self.get_input_pipeline(for_export=False)
      text_ds = text_ds.map(
          input_pipeline_func,
          num_parallel_calls=self.num_parallel_calls,
      )
      text_size_ds = text_ds.map(
          lambda x: compute_sen_lens(x, padding_token=0),
          num_parallel_calls=self.num_parallel_calls,
      )
      text_ds = tf.data.Dataset.zip((text_ds, text_size_ds))
  
      if self.infer_without_label:
          data_set = text_ds
      else:
          intent_label_ds = process_one_label_dataset(
              intent_label_ds, self.config, output_index=0
          )
          slots_label_ds = process_multi_label_dataset(
              slots_label_ds, self.config, output_index=1
          )
          data_set = tf.data.Dataset.zip(
              (text_ds, intent_label_ds, slots_label_ds)
          )
  
      self.config["data"]["vocab_size"] = get_vocab_size(
          self.text_vocab_file_path
      )
      self.config["data"][
          "{}_data_size".format(self.mode)
      ] = get_file_len(self.paths_after_pre_process)
  
      return data_set
  
file_path: delta/delta/data/task/text_nlu_joint_task.py
imports: import collections
  import delta.compat
  from absl import logging
  from delta.data.task.base_text_task import TextTask
  from delta.data.preprocess.text_ops import process_one_label_dataset
  from delta.data.preprocess.text_ops import process_multi_label_dataset
  from delta.data.utils.common_utils import get_file_len
  from delta.data.preprocess.text_ops import load_textline_dataset
  from delta.data.preprocess.utils import get_vocab_size
  from delta.utils.register import registers
  from delta.layers.utils import compute_sen_lens
  from delta import utils
label_desc: Use image node_id 3 for calling the TextNLUJointTask obj's underlying member method code with example usage: obj.generate_data() and returns: data_set