code: def __init__(
      self, args, nchars, emb_dim, hidden_dim, dropout, feat_dropout
  ):
      super().__init__()
  
      self.args = args
      feat_dim = args["feat_dim"]
  
      self.embeddings = nn.Embedding(nchars, emb_dim, padding_idx=0)
  
      self.rnn = nn.LSTM(
          emb_dim + feat_dim,
          hidden_dim,
          num_layers=self.args["rnn_layers"],
          bidirectional=True,
          batch_first=True,
          dropout=dropout if self.args["rnn_layers"] > 1 else 0,
      )
  
      if self.args["conv_res"] is not None:
          self.conv_res = nn.ModuleList()
          self.conv_sizes = [
              int(x) for x in self.args["conv_res"].split(",")
          ]
  
          for si, size in enumerate(self.conv_sizes):
              l = nn.Conv1d(
                  emb_dim + feat_dim,
                  hidden_dim * 2,
                  size,
                  padding=size // 2,
                  bias=self.args.get("hier_conv_res", False)
                  or (si == 0),
              )
              self.conv_res.append(l)
  
          if self.args.get("hier_conv_res", False):
              self.conv_res2 = nn.Conv1d(
                  hidden_dim * 2 * len(self.conv_sizes),
                  hidden_dim * 2,
                  1,
              )
      self.tok_clf = nn.Linear(hidden_dim * 2, 1)
      self.sent_clf = nn.Linear(hidden_dim * 2, 1)
      if self.args["use_mwt"]:
          self.mwt_clf = nn.Linear(hidden_dim * 2, 1)
  
      if args["hierarchical"]:
          in_dim = hidden_dim * 2
          self.rnn2 = nn.LSTM(
              in_dim,
              hidden_dim,
              num_layers=1,
              bidirectional=True,
              batch_first=True,
          )
          self.tok_clf2 = nn.Linear(hidden_dim * 2, 1, bias=False)
          self.sent_clf2 = nn.Linear(hidden_dim * 2, 1, bias=False)
          if self.args["use_mwt"]:
              self.mwt_clf2 = nn.Linear(hidden_dim * 2, 1, bias=False)
  
      self.dropout = nn.Dropout(dropout)
      self.dropout_feat = nn.Dropout(feat_dropout)
  
      self.toknoise = nn.Dropout(self.args["tok_noise"])
  
imports: import torch
  import torch.nn.functional
  import torch.nn
label_desc: Use image node_id 1 to create a new Tokenizer object from inherited base classes: nn with example: obj = Tokenizer(args, nchars, emb_dim, hidden_dim, dropout, feat_dropout)