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

Method _predict

textmatch/models/text_embedding/bow_sklearn.py:116–120  ·  view source on GitHub ↗
(self, words)

Source from the content-addressed store, hash-verified

114 self._gen_dic(word_list)
115
116 def _predict(self, words):
117 tf_idf_embedding = self.vectorizer.transform(self._seg_word([words]))
118 tf_idf_embedding = tf_idf_embedding.toarray().sum(axis=0)
119 # print ('>>>>', tf_idf_embedding[np.newaxis, :])
120 return tf_idf_embedding[np.newaxis, :].astype(float)
121
122 def predict(self, words):
123 pre = self._normalize( self._predict(words) )

Callers 3

initMethod · 0.95
predictMethod · 0.95
predict_embMethod · 0.45

Calls 2

_seg_wordMethod · 0.95
transformMethod · 0.80

Tested by

no test coverage detected