'Convert a list of words into vector form.
Arguments:
words (list) : List of words.
Returns:
list : Vectorized list of words.'

def words_to_vector(self, words):

    return [(self.word_to_index[w] if (w in self.word_to_index) else (self.vocab_size - 1)) for w in words]
