code: def __init__(
      self,
      data: DatasetSplits,
      embedding_size: int,
      num_channels: int,
      hidden_dim: int,
      dropout_p: float,
      padding_idx: int = 0,
      glove_path: str = None,
  ):
      super(NewsClassifier, self).__init__()
  
      self.num_embeddings = len(data.vectorizer.data_vocab)
      self.num_classes = len(data.vectorizer.target_vocab)
  
      self.num_channels: int = num_channels
      self.embedding_size: int = embedding_size
      self.hidden_dim: int = hidden_dim
      self.padding_idx: int = padding_idx
  
      if glove_path:
          logger.info("Using pre-trained word embeddings...")
          self.embeddings = Embedding(
              glove_filepath=glove_path, data=data
          ).embeddings
          self.embeddings = torch.from_numpy(self.embeddings).float()
          glove_size = len(self.embeddings[0])
          self.emb: torch.nn.Embedding = torch.nn.Embedding(
              embedding_dim=glove_size,
              num_embeddings=self.num_embeddings,
              padding_idx=self.padding_idx,
              _weight=self.embeddings,
          )
  
      else:
          logger.info("Not using pre-trained word embeddings...")
          self.emb: torch.nn.Embedding = torch.nn.Embedding(
              embedding_dim=self.embedding_size,
              num_embeddings=self.num_embeddings,
              padding_idx=self.padding_idx,
          )
  
      self.convnet = torch.nn.Sequential(
          torch.nn.Conv1d(
              in_channels=self.embedding_size,
              out_channels=self.num_channels,
              kernel_size=3,
          ),
          torch.nn.ELU(),
          torch.nn.Conv1d(
              in_channels=self.num_channels,
              out_channels=self.num_channels,
              kernel_size=3,
              stride=2,
          ),
          torch.nn.ELU(),
          torch.nn.Conv1d(
              in_channels=self.num_channels,
              out_channels=self.num_channels,
              kernel_size=3,
              stride=1,
          ),
          torch.nn.ELU(),
          torch.nn.Conv1d(
              in_channels=self.num_channels,
              out_channels=self.num_channels,
              kernel_size=3,
          ),  # Experimental change from 3 to 2
          torch.nn.ELU(),
      )
  
      self._dropout_p: float = dropout_p
      self.dropout = torch.nn.Dropout(p=dropout_p)
      self.fc1: torch.nn.Linear = torch.nn.Linear(
          self.num_channels, self.hidden_dim
      )
      self.fc2: torch.nn.Linear = torch.nn.Linear(
          self.hidden_dim, self.num_classes
      )
  
imports: import logging
  import string
  from collections import Counter
  from typing import Dict, List, Any
  import numpy
  import pandas
  import torch
  from transfer_nlp.common.tokenizers import CustomTokenizer
  from transfer_nlp.embeddings.embeddings import Embedding
  from transfer_nlp.loaders.loaders import DatasetSplits, DataFrameDataset
  from transfer_nlp.loaders.vectorizers import Vectorizer
  from transfer_nlp.loaders.vocabulary import Vocabulary, SequenceVocabulary
  from transfer_nlp.plugins.config import register_plugin
  from transfer_nlp.plugins.predictors import PredictorABC
label_desc: Use image node_id 1 to create a new NewsClassifier object from inherited base classes: torch.nn with example: obj = NewsClassifier(data, embedding_size, num_channels, hidden_dim, dropout_p, padding_idx, glove_path)