def METHOD_NAME(self, observation):
    """
    Override abstract method from TransformerRankerAgent to use knowledge field as
    memories.
    """
    if not self.use_knowledge:
        return observation
    observation['memory_vecs'] = []
    checked = observation.get('checked_sentence', '')
    if observation.get('knowledge'):
        knowledge = observation['knowledge'].split('\n')[:-1]
    else:
        knowledge = []
    to_vectorize = []
    if checked and self.chosen_sentence:
        # if `self.chosen_sentence` is True, only keep golden knowledge
        to_vectorize = [checked]
    elif (self.knowledge_dropout == 0 or not self.is_training) and knowledge:
        # during evaluation we use all of the knowledge
        to_vectorize = knowledge
    elif knowledge:
        for line in knowledge:
            if checked and checked in line:
                # make sure we keep the chosen sentence
                keep = 1
            else:
                # dropout knowledge
                keep = np.random.binomial(1, 1 - self.knowledge_dropout)
            if keep:
                to_vectorize.append(line)
    # vectorize knowledge
    observation.force_set(
        'memory_vecs',
        [
            self._vectorize_text(line, truncate=self.knowledge_truncate)
            for line in to_vectorize
        ],
    )
    return observation