class_docstr: NAML model(Neural News Recommendation with Attentive Multi-View Learning)
  
  Chuhan Wu, Fangzhao Wu, Mingxiao An, Jianqiang Huang, Yongfeng Huang and Xing Xie,
  Neural News Recommendation with Attentive Multi-View Learning, IJCAI 2019
  
  Attributes:
      word2vec_embedding (numpy.ndarray): Pretrained word embedding matrix.
      hparam (object): Global hyper-parameters.
class_docstr_tok: ["NAML","model","(","Neural","News","Recommendation","with","Attentive","Multi-View","Learning",")","Chuhan","Wu",",","Fangzhao","Wu",",","Mingxiao","An",",","Jianqiang","Huang",",","Yongfeng","Huang","and","Xing","Xie",",","Neural","News","Recommendation","with","Attentive","Multi-View","Learning",",","IJCAI","2019","Attributes",":","word2vec_embedding","(","numpy.ndarray",")",":","Pretrained","word","embedding","matrix",".","hparam","(","object",")",":","Global","hyper-parameters","."]
docstr: The main function to create user encoder of NAML.
  
  Args:
      newsencoder (object): the news encoder of NAML.
  
  Return:
      object: the user encoder of NAML.
docstr_tok: ["The","main","function","to","create","user","encoder","of","NAML",".","Args",":","newsencoder","(","object",")",":","the","news","encoder","of","NAML",".","Return",":","object",":","the","user","encoder","of","NAML","."]
code: def _build_userencoder(self, newsencoder):
      """The main function to create user encoder of NAML.
  
      Args:
          newsencoder (object): the news encoder of NAML.
  
      Return:
          object: the user encoder of NAML.
      """
      hparams = self.hparams
      his_input_title_body_verts = keras.Input(
          shape=(
              hparams.his_size,
              hparams.title_size + hparams.body_size + 2,
          ),
          dtype="int32",
      )
  
      click_news_presents = layers.TimeDistributed(newsencoder)(
          his_input_title_body_verts
      )
      user_present = AttLayer2(
          hparams.attention_hidden_dim, seed=self.seed
      )(click_news_presents)
  
      model = keras.Model(
          his_input_title_body_verts, user_present, name="user_encoder"
      )
      return model
  
file_path: recommenders/recommenders/models/newsrec/models/naml.py
imports: import numpy
  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
label_desc: Use image node_id 6 for calling the NAMLModel obj's underlying member method code with example usage: obj._build_userencoder(newsencoder) and returns: model