class_docstr: A convolutional neural network for text classification.
  
  We use different versions of this network to pretrain models for
  text classification.
code: def __init__(
      self,
      hidden_size=150,
      dropout=0.3,
      num_labels=2,
      max_seq_length=128,
      model_path=None,
      emb_layer_trainable=True,
  ):
      super().__init__()
      self._config = {
          "architectures": "WordCNNForClassification",
          "hidden_size": hidden_size,
          "dropout": dropout,
          "num_labels": num_labels,
          "max_seq_length": max_seq_length,
          "model_path": model_path,
          "emb_layer_trainable": emb_layer_trainable,
      }
      self.drop = nn.Dropout(dropout)
      self.emb_layer = GloveEmbeddingLayer(
          emb_layer_trainable=emb_layer_trainable
      )
      self.word2id = self.emb_layer.word2id
      self.encoder = CNNTextLayer(
          self.emb_layer.n_d, widths=[3, 4, 5], filters=hidden_size
      )
      d_out = 3 * hidden_size
      self.out = nn.Linear(d_out, num_labels)
      self.tokenizer = textattack.models.tokenizers.GloveTokenizer(
          word_id_map=self.word2id,
          unk_token_id=self.emb_layer.oovid,
          pad_token_id=self.emb_layer.padid,
          max_length=max_seq_length,
      )
  
      if model_path is not None:
          self.load_from_disk(model_path)
      self.eval()
  
imports: import json
  import os
  import torch
  from torch import nn
  from torch.nn import functional
  import textattack
  from textattack.model_args import TEXTATTACK_MODELS
  from textattack.models.helpers import GloveEmbeddingLayer
  from textattack.models.helpers.utils import load_cached_state_dict
  from textattack.shared import utils
label_desc: Use image node_id 1 to create a new WordCNNForClassification object from inherited base classes: nn with example: obj = WordCNNForClassification(hidden_size, dropout, num_labels, max_seq_length, model_path, emb_layer_trainable)