code: import torch.nn as nn
  
  class LSTMClassifier(nn.Module):
      """
      This is the simple RNN model we will be using to perform Sentiment Analysis.
      """
  
      def __init__(self, embedding_dim, hidden_dim, vocab_size):
          """
          Initialize the model by settingg up the various layers.
          """
          super(LSTMClassifier, self).__init__()
  
          self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=0)
          self.lstmA = nn.LSTM(embedding_dim, hidden_dim)
          self.lstmB = nn.LSTM(hidden_dim, hidden_dim)
          self.dense = nn.Linear(in_features=hidden_dim, out_features=1)
          self.sig = nn.Sigmoid()
          
          self.word_dict = None
  
      def forward(self, x):
          """
          Perform a forward pass of our model on some input.
          """
          x = x.t()
          lengths = x[0,:]
          reviews = x[1:,:]
          embeds = self.embedding(reviews)
          lstm_out1, _ = self.lstmA(embeds)
          lstm_out, _ = self.lstmB(lstm_out1)
          out = self.dense(lstm_out)
          out = out[lengths - 1, range(len(lengths))]
          return self.sig(out.squeeze())
apis: torch.nn.Sigmoid torch.nn.LSTM torch.nn.Linear torch.nn.Embedding