class_docstr: NRMS model(Neural News Recommendation with Multi-Head Self-Attention)
  
  Chuhan Wu, Fangzhao Wu, Suyu Ge, Tao Qi, Yongfeng Huang,and Xing Xie, "Neural News
  Recommendation with Multi-Head Self-Attention" in Proceedings of the 2019 Conference
  on Empirical Methods in Natural Language Processing and the 9th International Joint Conference
  on Natural Language Processing (EMNLP-IJCNLP)
  
  Attributes:
      word2vec_embedding (numpy.ndarray): Pretrained word embedding matrix.
      hparam (object): Global hyper-parameters.
docstr: The main function to create user encoder of NRMS.
  
  Args:
      titleencoder (object): the news encoder of NRMS.
  
  Return:
      object: the user encoder of NRMS.
docstr_tok: ["The","main","function","to","create","user","encoder","of","NRMS",".","Args",":","titleencoder","(","object",")",":","the","news","encoder","of","NRMS",".","Return",":","object",":","the","user","encoder","of","NRMS","."]
code: def _build_userencoder(self, titleencoder):
      """The main function to create user encoder of NRMS.
  
      Args:
          titleencoder (object): the news encoder of NRMS.
  
      Return:
          object: the user encoder of NRMS.
      """
      hparams = self.hparams
      his_input_title = keras.Input(
          shape=(hparams.his_size, hparams.title_size), dtype="int32"
      )
  
      click_title_presents = layers.TimeDistributed(titleencoder)(
          his_input_title
      )
      y = SelfAttention(
          hparams.head_num, hparams.head_dim, seed=self.seed
      )([click_title_presents] * 3)
      user_present = AttLayer2(
          hparams.attention_hidden_dim, seed=self.seed
      )(y)
  
      model = keras.Model(
          his_input_title, user_present, name="user_encoder"
      )
      return model
  
file_path: recommenders/recommenders/models/newsrec/models/nrms.py
imports: import tensorflow.keras
  from tensorflow.keras import layers
  from recommenders.models.newsrec.models.base_model import BaseModel
  from recommenders.models.newsrec.models.layers import AttLayer2, SelfAttention
label_desc: Use image node_id 6 for calling the NRMSModel obj's underlying member method code with example usage: obj._build_userencoder(titleencoder) and returns: model