class_docstr: Base class for text classification.
code: def __init__(self, config, **kwargs):
      super().__init__(**kwargs)
      model_config = config["model"]["net"]["structure"]
      if "dense_input" in model_config:
          self.use_dense_task = True
          self.use_dense_input = model_config["dense_input"][
              "use_dense_input"
          ]
          self.only_dense_input = model_config["dense_input"][
              "only_dense_input"
          ]
          self.dense_input_dim = config["data"]["task"][
              "dense_input_dim"
          ]
      else:
          self.use_dense_task = False
          self.use_dense_input = False
  
      if self.use_dense_input:
          self.dense_input_linear = tf.keras.layers.Dense(
              self.dense_input_dim,
              activation=tf.keras.activations.linear,
          )
  
      self.use_pretrained_model = config["model"].get(
          "use_pre_train_model", False
      )
      if self.use_pretrained_model:
          pretrained_model_config = config["model"]["pre_train_model"]
          self.pretrained_model_name = pretrained_model_config["name"]
          self.pretrained_model_mode = pretrained_model_config["mode"]
          self.pretrained_model_dim = pretrained_model_config["dim"]
          self.pretrained_model_path = pretrained_model_config["path"]
          self.pretrained_model_seg = pretrained_model_config["seg"]
          self.pretrained_model_cls = pretrained_model_config["cls"]
          self.pretrained_model_pad = pretrained_model_config["pad"]
          self.pretrained_model_layers = pretrained_model_config[
              "layers"
          ]
          self.pretrained_model_output = pretrained_model_config[
              "output"
          ]
  
file_path: delta/delta/models/text_cls_model.py
imports: import delta.compat
  from delta.models.base_model import Model
  from delta.layers.utils import get_pad_mask_from_token_idx
  from delta.layers.utils import get_seg_mask_from_token_idx
label_desc: Use image node_id 1 to create a new TextClassModel object from inherited base classes: Model with example: obj = TextClassModel(config)