class_docstr: LSTUR model(Neural News Recommendation with Multi-Head Self-Attention)
  
  Mingxiao An, Fangzhao Wu, Chuhan Wu, Kun Zhang, Zheng Liu and Xing Xie:
  Neural News Recommendation with Long- and Short-term User Representations, ACL 2019
  
  Attributes:
      word2vec_embedding (numpy.ndarray): Pretrained word embedding matrix.
      hparam (object): Global hyper-parameters.
docstr: The main function to create LSTUR's logic. The core of LSTUR
  is a user encoder and a news encoder.
  
  Returns:
      object: a model used to train.
      object: a model used to evaluate and inference.
docstr_tok: ["The","main","function","to","create","LSTUR","'s","logic",".","The","core","of","LSTUR","is","a","user","encoder","and","a","news","encoder",".","Returns",":","object",":","a","model","used","to","train",".","object",":","a","model","used","to","evaluate","and","inference","."]
code: def _build_lstur(self):
      """The main function to create LSTUR's logic. The core of LSTUR
      is a user encoder and a news encoder.
  
      Returns:
          object: a model used to train.
          object: a model used to evaluate and inference.
      """
      hparams = self.hparams
  
      his_input_title = keras.Input(
          shape=(hparams.his_size, hparams.title_size), dtype="int32"
      )
      pred_input_title = keras.Input(
          shape=(hparams.npratio + 1, hparams.title_size), dtype="int32"
      )
      pred_input_title_one = keras.Input(
          shape=(
              1,
              hparams.title_size,
          ),
          dtype="int32",
      )
      pred_title_reshape = layers.Reshape((hparams.title_size,))(
          pred_input_title_one
      )
      user_indexes = keras.Input(shape=(1,), dtype="int32")
  
      embedding_layer = layers.Embedding(
          self.word2vec_embedding.shape[0],
          hparams.word_emb_dim,
          weights=[self.word2vec_embedding],
          trainable=True,
      )
  
      titleencoder = self._build_newsencoder(embedding_layer)
      self.userencoder = self._build_userencoder(
          titleencoder, type=hparams.type
      )
      self.newsencoder = titleencoder
  
      user_present = self.userencoder([his_input_title, user_indexes])
      news_present = layers.TimeDistributed(self.newsencoder)(
          pred_input_title
      )
      news_present_one = self.newsencoder(pred_title_reshape)
  
      preds = layers.Dot(axes=-1)([news_present, user_present])
      preds = layers.Activation(activation="softmax")(preds)
  
      pred_one = layers.Dot(axes=-1)([news_present_one, user_present])
      pred_one = layers.Activation(activation="sigmoid")(pred_one)
  
      model = keras.Model(
          [user_indexes, his_input_title, pred_input_title], preds
      )
      scorer = keras.Model(
          [user_indexes, his_input_title, pred_input_title_one],
          pred_one,
      )
  
      return model, scorer
  
file_path: recommenders/recommenders/models/newsrec/models/lstur.py
imports: import tensorflow.compat.v1.keras
  from tensorflow.compat.v1.keras import layers
  from recommenders.models.newsrec.models.base_model import BaseModel
  from recommenders.models.newsrec.models.layers import AttLayer2, ComputeMasking, OverwriteMasking
label_desc: Use image node_id 8 for calling the LSTURModel obj's underlying member method code with example usage: obj._build_lstur() and returns: model,  scorer