takes in a word_indices vector and produces a feature vector from the word indices