class_docstr: Base task for NLP.
class_docstr_tok: ["Base","task","for","NLP","."]
code: def __init__(self, config, mode):
      super().__init__(config)
      self.all_modes = [utils.TRAIN, utils.EVAL, utils.INFER]
      assert mode in self.all_modes
      self.preparer = None
      self.use_preparer = True
      self.mode = mode
      self.model_config = config["model"]
      self.data_config = config["data"]
      self.task_config = self.data_config["task"]
  
      self.infer_no_label = self.data_config[utils.INFER].get(
          "infer_no_label", False
      )
      if self.mode == utils.INFER and self.infer_no_label:
          self.infer_without_label = True
      else:
          self.infer_without_label = False
  
      self.batch_size = self.task_config["batch_size"]
      self.epochs = self.task_config["epochs"]
      self.num_parallel_calls = self.task_config["num_parallel_calls"]
      self.num_prefetch_batch = self.task_config["num_prefetch_batch"]
      self.shuffle_buffer_size = self.task_config["shuffle_buffer_size"]
      self.need_shuffle = self.task_config["need_shuffle"]
  
file_path: delta/delta/data/task/base_text_task.py
imports: import os
  from absl import logging
  from delta.data.task.base_task import Task
  from delta import utils
  from delta.utils.register import registers
  from delta.data.preprocess.text_ops import clean_english_str_tf
  from delta.data.preprocess.text_ops import char_cut_tf
  from delta.data.preprocess.text_ops import tokenize_sentence
  from delta.data.preprocess.text_ops import chinese_word_cut_tf
label_desc: Use image node_id 1 to create a new TextTask object from inherited base classes: Task with example: obj = TextTask(config, mode)