def sentence2vec(self, sentence): sentence = Sentence(sentence, self.seg) vec_bow = self.dictionary.doc2bow(sentence.get_cuted_sentence()) return self.model[vec_bow]
def sentence2vec(self,sentence): sentence = Sentence(sentence,self.seg) vec_bow = self.dictionary.doc2bow(sentence.get_cuted_sentence()) return self.model[vec_bow]
def sen2vec(self, sentence): sentence = Sentence(sentence, self.seg) # word in current sentence -> bow (= word freq) vec_bow = self.dicts.doc2bow(sentence.get_cuted_sentence()) return self.model[vec_bow] # apply model to bow, convert bow to vec