def METHOD_NAME(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