class_docstr: CNN-LSTM embedder (based on Ma and Hovy. 2016)
  
  Args:
      word_vocab_size (int): word vocabulary size
      num_labels (int): number of labels (classifier)
      word_embedding_dims (int, optional): word embedding dims
      char_embedding_dims (int, optional): character embedding dims
      cnn_kernel_size (int, optional): character CNN kernel size
      cnn_num_filters (int, optional): character CNN number of filters
      lstm_hidden_size (int, optional): LSTM embedder hidden size
      lstm_layers (int, optional): num of LSTM layers
      bidir (bool, optional): apply bi-directional LSTM
      dropout (float, optional): dropout rate
      padding_idx (int, optinal): padding number for embedding layers
class_docstr_tok: ["CNN-LSTM","embedder","(","based","on","Ma","and","Hovy",".","2016",")","Args",":","word_vocab_size","(","int",")",":","word","vocabulary","size","num_labels","(","int",")",":","number","of","labels","(","classifier",")","word_embedding_dims","(","int",",","optional",")",":","word","embedding","dims","char_embedding_dims","(","int",",","optional",")",":","character","embedding","dims","cnn_kernel_size","(","int",",","optional",")",":","character","CNN","kernel","size","cnn_num_filters","(","int",",","optional",")",":","character","CNN","number","of","filters","lstm_hidden_size","(","int",",","optional",")",":","LSTM","embedder","hidden","size","lstm_layers","(","int",",","optional",")",":","num","of","LSTM","layers","bidir","(","bool",",","optional",")",":","apply","bi-directional","LSTM","dropout","(","float",",","optional",")",":","dropout","rate","padding_idx","(","int",",","optinal",")",":","padding","number","for","embedding","layers"]
code: def __init__(
      self,
      word_vocab_size: int,
      num_labels: int,
      word_embedding_dims: int = 100,
      char_embedding_dims: int = 16,
      cnn_kernel_size: int = 3,
      cnn_num_filters: int = 128,
      lstm_hidden_size: int = 100,
      lstm_layers: int = 2,
      bidir: bool = True,
      dropout: float = 0.5,
      padding_idx: int = 0,
  ):
      super(CNNLSTM, self).__init__()
      self.word_embedding_dim = word_embedding_dims
      self.word_embeddings = nn.Embedding(
          word_vocab_size, word_embedding_dims, padding_idx=padding_idx
      )
      self.char_embeddings = nn.Embedding(
          n_letters + 1, char_embedding_dims, padding_idx=padding_idx
      )
      self.conv1 = nn.Conv1d(
          in_channels=char_embedding_dims,
          out_channels=cnn_num_filters,
          kernel_size=cnn_kernel_size,
          padding=int(cnn_kernel_size / 2),
      )
      self.relu = nn.ReLU()
  
      self.lstm = nn.LSTM(
          input_size=word_embedding_dims + cnn_num_filters,
          hidden_size=lstm_hidden_size,
          bidirectional=bidir,
          batch_first=True,
          num_layers=lstm_layers,
      )
      self.dropout = nn.Dropout(dropout)
      self.dense = nn.Linear(
          in_features=lstm_hidden_size * 2
          if bidir
          else lstm_hidden_size,
          out_features=num_labels,
      )
      self.num_labels = num_labels
      self.padding_idx = padding_idx
  
file_path: nlp-architect/nlp_architect/nn/torch/modules/embedders.py
imports: import os
  from typing import List
  import torch
  from torch import nn
  import torch.nn.functional
  from nlp_architect.utils.io import load_json_file
  from nlp_architect.utils.text import n_letters
label_desc: Use image node_id 1 to create a new CNNLSTM object from inherited base classes: nn with example: obj = CNNLSTM(word_vocab_size, num_labels, word_embedding_dims, char_embedding_dims, cnn_kernel_size, cnn_num_filters, lstm_hidden_size, lstm_layers, bidir, dropout, padding_idx)