added code to create feature vectors from word indices