code: def __init__(
      self,
      vocab_size,
      type_size,
      max_position_seq_len,
      num_layers,
      n_head,
      hidden_size,
      attn_dropout,
      act_dropout,
  ):
      super(NSP, self).__init__()
  
      self.n_head = n_head
      self.hidden_size = hidden_size
  
      self.word_embedding_layer = nn.Embedding(vocab_size, hidden_size)
      self.sent_embedding_layer = nn.Embedding(type_size, hidden_size)
      self.pos_embedding_layer = nn.Embedding(
          max_position_seq_len, hidden_size
      )
  
      encoder_layer = nn.TransformerEncoderLayer(
          hidden_size,
          n_head,
          hidden_size * 4,
          act_dropout,
          "gelu",
          attn_dropout,
          act_dropout,
          "True",
      )
      encoder_norm = nn.LayerNorm(hidden_size)
      self.encoder = nn.TransformerEncoder(
          encoder_layer, num_layers, encoder_norm
      )
      self.fc1 = nn.Linear(hidden_size, hidden_size)
      self.fc2 = nn.Linear(hidden_size, 2)
  
      self.dropout_layer = nn.Dropout(act_dropout)
      self.tanh_layer = nn.Tanh()
      self.softmax = nn.Softmax()
  
imports: from collections import namedtuple
  import paddle
  import paddle.nn
  import paddle.nn.functional
label_desc: Use image node_id 1 to create a new NSP object from inherited base classes: nn with example: obj = NSP(vocab_size, type_size, max_position_seq_len, num_layers, n_head, hidden_size, attn_dropout, act_dropout)