'Preprocesses text for the encoder.
Args:
data: A list of input strings.
use_eos: Whether to append the end-of-sentence word to each sentence.
Returns:
embeddings: A list of word embedding sequences corresponding to the input
strings.'

def _preprocess(self, data, use_eos):

    preprocessed_data = []
    for item in data:
        tokenized = self._tokenize(item)
        if use_eos:
            tokenized.append(special_words.EOS)
        preprocessed_data.append([self._word_to_embedding(w) for w in tokenized])
    return preprocessed_data
