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: build title encoder of NAML news encoder.
  
  Args:
      embedding_layer (object): a word embedding layer.
  
  Return:
      object: the title encoder of NAML.
docstr_tok: ["build","title","encoder","of","NAML","news","encoder",".","Args",":","embedding_layer","(","object",")",":","a","word","embedding","layer",".","Return",":","object",":","the","title","encoder","of","NAML","."]
code: def _build_titleencoder(self, embedding_layer):
      """build title encoder of NAML news encoder.
  
      Args:
          embedding_layer (object): a word embedding layer.
  
      Return:
          object: the title encoder of NAML.
      """
      hparams = self.hparams
      sequences_input_title = keras.Input(
          shape=(hparams.title_size,), dtype="int32"
      )
      embedded_sequences_title = embedding_layer(sequences_input_title)
  
      y = layers.Dropout(hparams.dropout)(embedded_sequences_title)
      y = layers.Conv1D(
          hparams.filter_num,
          hparams.window_size,
          activation=hparams.cnn_activation,
          padding="same",
          bias_initializer=keras.initializers.Zeros(),
          kernel_initializer=keras.initializers.glorot_uniform(
              seed=self.seed
          ),
      )(y)
      y = layers.Dropout(hparams.dropout)(y)
      pred_title = AttLayer2(
          hparams.attention_hidden_dim, seed=self.seed
      )(y)
      pred_title = layers.Reshape((1, hparams.filter_num))(pred_title)
  
      model = keras.Model(
          sequences_input_title, pred_title, name="title_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 8 for calling the NAMLModel obj's underlying member method code with example usage: obj._build_titleencoder(embedding_layer) and returns: model