class_docstr: Task class for text Match.
class_docstr_tok: ["Task","class","for","text","Match","."]
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 = 2
          text_ds_left, text_ds_right = load_textline_dataset(
              self.paths_after_pre_process, column_num
          )
      else:
          column_num = 3
          label, text_ds_left, text_ds_right = load_textline_dataset(
              self.paths_after_pre_process, column_num
          )
  
      input_pipeline_func = self.get_input_pipeline(for_export=False)
      text_ds_left = text_ds_left.map(
          input_pipeline_func,
          num_parallel_calls=self.num_parallel_calls,
      )
      text_ds_right = text_ds_right.map(
          input_pipeline_func,
          num_parallel_calls=self.num_parallel_calls,
      )
      text_size_ds_left = text_ds_left.map(
          lambda x: compute_sen_lens(x, padding_token=0),
          num_parallel_calls=self.num_parallel_calls,
      )
      text_size_ds_right = text_ds_right.map(
          lambda x: compute_sen_lens(x, padding_token=0),
          num_parallel_calls=self.num_parallel_calls,
      )
      text_ds_left_right = tf.data.Dataset.zip(
          (text_ds_left, text_ds_right)
      )
      text_len_left_right = tf.data.Dataset.zip(
          (text_size_ds_left, text_size_ds_right)
      )
      if self.infer_without_label:
          data_set_left_right = text_ds_left_right
      else:
          label_ds = process_one_label_dataset(label, self.config)
          data_set_left_right = tf.data.Dataset.zip(
              (text_ds_left_right, label_ds)
          )
      vocab_dict = load_vocab_dict(self.text_vocab_file_path)
      vocab_size = len(vocab_dict)
  
      self.config["data"]["vocab_size"] = vocab_size
      self.config["data"][
          "{}_data_size".format(self.mode)
      ] = get_file_len(self.paths_after_pre_process)
  
      return data_set_left_right, text_len_left_right
  
file_path: delta/delta/data/task/text_match_task.py
imports: import collections
  from absl import logging
  import delta.compat
  from delta.data.task.base_text_task import TextTask
  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 load_vocab_dict
  from delta.data.preprocess.text_ops import process_one_label_dataset
  from delta.utils.register import registers
  from delta.layers.utils import compute_sen_lens
  from delta import utils
label_desc: Use image node_id 2 for calling the TextMatchTask obj's underlying member method code with example usage: obj.generate_data() and returns: data_set_left_right,  text_len_left_right