def prepare(self, train): all_words = list(util.wordsFromQuestionList(train, self.ngram_cap)) self.wordIndices = {} for idx, word in enumerate(all_words): for syn in util.getSyns(word): self.wordIndices[syn] = idx self.vecDim = len(all_words)
def prepare(self, train): all_words = list(util.wordsFromQuestionList(train)) self.wordIndices = {} for idx, word in enumerate(all_words): self.wordIndices[word] = idx self.vecDim = len(all_words)