Search code examples
tensorflowdeep-learningtext-classificationword2vec

Saving Word2Vec for CNN Text Classification


I want to train my own Word2Vec model for my text corpus. I can get the code from TensorFlow's tutorial. What I don't know is how to save this model to use for CNN text classification later? Should I use pickle to save it and then read it later?


Solution

  • No pickling is not the way of saving the model in case of tensorflow.

    Tensorflow provides with tensorflow serving for saving the models as proto bufs(for exporting the model). The way to save model would be to save the tensorflow session as: saver.save(sess, 'my_test_model',global_step=1000)

    Heres the link for complete answer: Tensorflow: how to save/restore a model?