original_docstring: The main function to create news encoder of NRMS.
  
          Args:
              embedding_layer (object): a word embedding layer.
  
          Return:
              object: the news encoder of NRMS.
          
docstring: The main function to create news encoder of NRMS.
docstring_tokens: The main function to create news encoder of NRMS .
code: def _build_newsencoder(self, embedding_layer):
          """The main function to create news encoder of NRMS.
  
          Args:
              embedding_layer (object): a word embedding layer.
  
          Return:
              object: the news encoder of NRMS.
          """
          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 = SelfAttention(hparams.head_num, hparams.head_dim, seed=self.seed)([y, y, y])
          y = layers.Dropout(hparams.dropout)(y)
          pred_title = AttLayer2(hparams.attention_hidden_dim, seed=self.seed)(y)
  
          model = keras.Model(sequences_input_title, pred_title, name="news_encoder")
          return model
code_tokens: def _build_newsencoder ( self , embedding_layer ) : 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 = SelfAttention ( hparams . head_num , hparams . head_dim , seed = self . seed ) ( [ y , y , y ] ) y = layers . Dropout ( hparams . dropout ) ( y ) pred_title = AttLayer2 ( hparams . attention_hidden_dim , seed = self . seed ) ( y ) model = keras . Model ( sequences_input_title , pred_title , name = "news_encoder" ) return model
short_docstring: The main function to create news encoder of NRMS.
short_docstring_tokens: The main function to create news encoder of NRMS .
comment: """The main function to create news encoder of NRMS.
  
          Args:
              embedding_layer (object): a word embedding layer.
  
          Return:
              object: the news encoder of NRMS.
          """