class_docstr: Task class for text classification.
class_docstr_tok: ["Task","class","for","text","classification","."]
code: def __init__(self, config, mode):
      super().__init__(config, mode)
      self.infer_no_label = self.config["data"][utils.INFER].get(
          "infer_no_label", False
      )
      self.vocab_min_frequency = self.task_config["vocab_min_frequency"]
      self.text_vocab_file_path = self.task_config["text_vocab"]
      self.label_vocab_file_path = self.task_config["label_vocab"]
      self.max_seq_len = self.task_config["max_seq_len"]
      self.num_classes = self.task_config["classes"]["num_classes"]
      self.use_true_length = self.model_config.get(
          "use_true_length", False
      )
      self.split_token = self.model_config.get("split_token", "")
      self.use_dense = self.task_config["use_dense"]
      if self.use_dense:
          self.dense_input_dim = self.task_config["dense_input_dim"]
          self.dense_npy = config["data"][self.mode]["dense_npy"]
      self.paths = self.data_config[mode]["paths"]
      self.paths_after_pre_process = [
          one_path + ".after" for one_path in self.paths
      ]
      self.infer_without_label = bool(
          mode == utils.INFER and self.infer_no_label
      )
  
      self.prepare()
  
file_path: delta/delta/data/task/text_cls_task.py
imports: import collections
  import delta.compat
  from absl import logging
  from delta.data.task.base_text_task import TextTask
  from delta.data.utils.common_utils import load_npy
  from delta.data.utils.common_utils import get_file_len
  from delta.data.preprocess.text_ops import process_one_label_dataset
  from delta.data.preprocess.text_ops import load_dense_dataset
  from delta.data.preprocess.utils import load_vocab_dict
  from delta.data.preprocess.text_ops import load_textline_dataset
  from delta import utils
  from delta.utils.register import registers
  from delta.layers.utils import compute_sen_lens
label_desc: Use image node_id 1 to create a new TextClsTask object from inherited base classes: TextTask with example: obj = TextClsTask(config, mode)