code: def simple_lstm(
      max_features,
      dense_out,
      input_length,
      embed_dim=256,
      lstm_out=140,
      dropout=0.5,
  ):
      """
      Simple Bi-direction LSTM Model in Keras
  
      Single layer bi-directional lstm with recurrent dropout and a fully connected layer
  
      Args:
          max_features (int): vocabulary size
          dense_out (int): size out the output dense layer, this is the number of classes
          input_length (int): length of the input text
          embed_dim (int): internal embedding size used in the lstm
          lstm_out (int): size of the bi-directional output layer
          dropout (float): value for recurrent dropout, between 0 and 1
  
      Returns:
          model (model): LSTM model
      """
      model = tf.keras.models.Sequential()
      model.add(
          tf.keras.layers.Embedding(
              max_features, embed_dim, input_length=input_length
          )
      )
      model.add(
          tf.keras.layers.Bidirectional(
              tf.keras.layers.LSTM(
                  lstm_out, recurrent_dropout=dropout, activation="tanh"
              )
          )
      )
      model.add(tf.keras.layers.Dense(dense_out, activation="softmax"))
      model.compile(
          loss="categorical_crossentropy",
          optimizer="adam",
          metrics=["accuracy"],
      )
  
      return model
  
label_desc: Use image node_id 1 for calling a global function with example usage: simple_lstm(max_features, dense_out, input_length, embed_dim, lstm_out, dropout) and returns: model