MCPcopy Create free account
hub / github.com/apache/singa / get_idx2vec_weights

Function get_idx2vec_weights

examples/qabot/qabot_data.py:168–173  ·  view source on GitHub ↗
(wv, idx2word)

Source from the content-addressed store, hash-verified

166
167
168def get_idx2vec_weights(wv, idx2word):
169 idx2vec = {k: wv[v] for k, v in idx2word.items() if v in wv}
170
171 # add padding embedding (all zeros) to idx2vec lookup
172 idx2vec[pad_idx] = pad_embed
173 return idx2vec
174
175
176def prepare_data(use_cache=True):

Callers 1

prepare_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected