'Convert a sentence to a list of ids, with special tokens added.'

def encode(self, sentence):

    word_ids = [self.word_to_id(cur_word) for cur_word in sentence.split()]
    return np.array((([self.bos] + word_ids) + [self.eos]), dtype=np.int32)
