code: def __init__(
      self,
      n_users,
      n_items,
      n_vocab,
      embedding_matrix,
      global_mean,
      n_factors=32,
      embedding_size=100,
      id_embedding_size=32,
      attention_size=16,
      kernel_sizes=[3],
      n_filters=64,
      dropout_rate=0.5,
      max_text_length=50,
  ):
      super().__init__()
      self.l_user_review_embedding = layers.Embedding(
          n_vocab,
          embedding_size,
          embeddings_initializer=embedding_matrix,
          mask_zero=True,
          name="layer_user_review_embedding",
      )
      self.l_item_review_embedding = layers.Embedding(
          n_vocab,
          embedding_size,
          embeddings_initializer=embedding_matrix,
          mask_zero=True,
          name="layer_item_review_embedding",
      )
      self.l_user_iid_embedding = layers.Embedding(
          n_items,
          id_embedding_size,
          embeddings_initializer="uniform",
          name="user_iid_embedding",
      )
      self.l_item_uid_embedding = layers.Embedding(
          n_users,
          id_embedding_size,
          embeddings_initializer="uniform",
          name="item_uid_embedding",
      )
      self.l_user_embedding = layers.Embedding(
          n_users,
          id_embedding_size,
          embeddings_initializer="uniform",
          name="user_embedding",
      )
      self.l_item_embedding = layers.Embedding(
          n_items,
          id_embedding_size,
          embeddings_initializer="uniform",
          name="item_embedding",
      )
      self.user_bias = layers.Embedding(
          n_users,
          1,
          embeddings_initializer=tf.initializers.Constant(0.1),
          name="user_bias",
      )
      self.item_bias = layers.Embedding(
          n_items,
          1,
          embeddings_initializer=tf.initializers.Constant(0.1),
          name="item_bias",
      )
      self.user_text_processor = TextProcessor(
          max_text_length,
          filters=n_filters,
          kernel_sizes=kernel_sizes,
          dropout_rate=dropout_rate,
          name="user_text_processor",
      )
      self.item_text_processor = TextProcessor(
          max_text_length,
          filters=n_filters,
          kernel_sizes=kernel_sizes,
          dropout_rate=dropout_rate,
          name="item_text_processor",
      )
      self.a_user = keras.models.Sequential(
          [
              layers.Dense(
                  attention_size, activation="relu", use_bias=True
              ),
              layers.Dense(1, activation=None, use_bias=True),
          ]
      )
      self.user_attention = layers.Softmax(
          axis=1, name="user_attention"
      )
      self.a_item = keras.models.Sequential(
          [
              layers.Dense(
                  attention_size, activation="relu", use_bias=True
              ),
              layers.Dense(1, activation=None, use_bias=True),
          ]
      )
      self.item_attention = layers.Softmax(
          axis=1, name="item_attention"
      )
      self.user_Oi_dropout = layers.Dropout(
          rate=dropout_rate, name="user_Oi"
      )
      self.Xu = layers.Dense(n_factors, use_bias=True, name="Xu")
      self.item_Oi_dropout = layers.Dropout(
          rate=dropout_rate, name="item_Oi"
      )
      self.Yi = layers.Dense(n_factors, use_bias=True, name="Yi")
  
      self.W1 = layers.Dense(
          1, activation=None, use_bias=False, name="W1"
      )
      self.add_global_bias = AddGlobalBias(
          init_value=global_mean, name="global_bias"
      )
  
imports: import numpy
  import tensorflow
  from tensorflow import keras
  from tensorflow.keras import layers, initializers, Input
  from tensorflow.python.keras.preprocessing.sequence import pad_sequences
  from ...utils import get_rng
  from ...utils.init_utils import uniform
label_desc: Use image node_id 1 to create a new Model object from inherited base classes: keras with example: obj = Model(n_users, n_items, n_vocab, embedding_matrix, global_mean, n_factors, embedding_size, id_embedding_size, attention_size, kernel_sizes, n_filters, dropout_rate, max_text_length)