GradySimon / tensorflow-glove

An implementation of GloVe in TensorFlow
292 stars 108 forks source link

A way to save trained word vectors? #5

Open park opened 7 years ago

park commented 7 years ago

Nice work!

Is there a way to save the trained word vectors into text or binary files for later use?

Thanks.

EddieOne commented 7 years ago

checkpoints are one way, https://www.tensorflow.org/programmers_guide/variables#checkpoint_files

MrRexZ commented 7 years ago

I think given that the tensorflow graph node implementation has shape that is reliant on the vocab size, evaluating it into a numpy array and saving the parameters into a pickle file would be more effficient. Otherwise if by using checkpoint, one would have to load the model with old graph with the nodes shape of old vocab size, recreate the graph with the new vocab size after fitting the model to corpus.

Seafoodair commented 4 years ago

nice work

EddieOne commented 4 years ago

I forgot to post it, I did manage this. https://github.com/EddieOne/tf-glove-deluxe