MatchZoo icon indicating copy to clipboard operation
MatchZoo copied to clipboard

How to get word embedding vector from saved weights?

Open restato opened this issue 7 years ago • 1 comments

I think this question is related in https://github.com/NTMC-Community/MatchZoo/issues/101 when I use pre-trained embed in training. How to get word embedding vector from saved weights? I want to check difference between pre-trained word embedding (glove) and trained embedding vector and then evaluate embedding vectors using tensorboard.

restato avatar Jan 08 '19 09:01 restato

As MatchZoo use keras as backend. The word embedding is also the weight matrix in the word embedding layer. Thus, you can directly dump the weight matrix of the embedding layer. As for how to dump, you can refer to this page.

faneshion avatar Jan 10 '19 01:01 faneshion