class_docstr: CNN model for text classification.
class_docstr_tok: ["CNN","model","for","text","classification","."]
code: def __init__(self, config, **kwargs):
      super().__init__(config, **kwargs)
      model_config = config["model"]["net"]["structure"]
      self.dropout_rate = model_config["dropout_rate"]
  
      self.sequence_length = config["data"]["task"]["max_seq_len"]
      self.vocab_size = config["data"]["vocab_size"]
      self.num_classes = config["data"]["task"]["classes"][
          "num_classes"
      ]
  
      self.embedding_size = model_config["embedding_size"]
      self.num_units = model_config["num_units"]
      self.num_layers = model_config["num_layers"]
      self.filter_sizes = model_config["filter_sizes"]
      self.num_filters = model_config["num_filters"]
  
      self.l2_reg_lambda = model_config["l2_reg_lambda"]
  
      self.embed = tf.keras.layers.Embedding(
          self.vocab_size,
          self.embedding_size,
          embeddings_initializer=self.embed_initializer,
      )
  
      self.conv2ds = []
      self.pools = []
      for i, filter_size in enumerate(self.filter_sizes):
          conv2d = tf.keras.layers.Conv2D(
              filters=self.num_filters,
              kernel_size=(filter_size, self.embedding_size),
              kernel_initializer=tf.truncated_normal_initializer(
                  stddev=0.02
              ),
              bias_initializer=tf.constant_initializer(value=0.0),
              padding="valid",
              name="conv_{}".format(i),
          )
          pool = tf.keras.layers.MaxPool2D(
              pool_size=(self.sequence_length - filter_size + 1, 1),
              strides=(1, 1),
              padding="valid",
              name="name_{}".format(i),
          )
          self.conv2ds.append(conv2d)
          self.pools.append(pool)
  
      self.flat = tf.keras.layers.Flatten()
  
      self.dense = tf.keras.layers.Dense(
          64, activation=tf.keras.activations.relu
      )
  
      self.dropout = tf.keras.layers.Dropout(rate=self.dropout_rate)
  
      self.final_dense = tf.keras.layers.Dense(
          self.num_classes, activation=tf.keras.activations.linear
      )
  
imports: import pickle
  import delta.compat
  from absl import logging
  from delta import layers
  from delta.models.text_cls_model import TextClassModel
  from delta.utils.register import registers
  from delta import utils
label_desc: Use image node_id 1 to create a new SeqclassCNNModel object from inherited base classes: SeqclassModel with example: obj = SeqclassCNNModel(config)