MCPcopy Create free account
hub / github.com/MachineLP/TextMatch / init

Method init

textmatch/models/text_embedding/w2v.py:70–76  ·  view source on GitHub ↗
(self, words_list=None, update=True, del_stopword=cfg.emb.DEL_STOPWORD)

Source from the content-addressed store, hash-verified

68
69
70 def init(self, words_list=None, update=True, del_stopword=cfg.emb.DEL_STOPWORD):
71 if words_list!=None:
72 self.words_list_pre = []
73 for words in words_list:
74 self.words_list_pre.append( self.w2v_model._predict(words, del_stopword)[0] )
75 self.words_list_pre = self._normalize(self.words_list_pre)
76 return self
77
78 def predict(self, words, del_stopword=cfg.emb.DEL_STOPWORD):
79 pre = [self.w2v_model._predict(words, del_stopword)[0]]

Callers

nothing calls this directly

Calls 2

_predictMethod · 0.45
_normalizeMethod · 0.45

Tested by

no test coverage detected