3 ms·
This looks pretty nice. It's worth pointing to the seq2seq TensorFlow example which covers a lot of similar topics. Is there an example anywhere of how to init
by nl 11y ago
This looks pretty nice. It's worth pointing to the seq2seq TensorFlow example which covers a lot of similar topics.
Is there an example anywhere of how to initilize from the word2vec embeddings?
- dennybritz 11y agoI'm not sure if there is an example somewhere in the TF docs, but initializing a variable is pretty easy. All you need to do is: session.run(W.assign(numpy_word2_vec_matrix)). W would the embedding matrix created in first layer of the code. [1] Of course you'd first need to load word2vec and filter its vocabulary to match your own vocabulary. That's most of the code and not specific to TensorFlow. You could use gensim [2] for that. [1] https://www.tensorflow.org/versions/master/api_docs/python/state_ops.html#Variable https://www.tensorflow.org/versions/master/api_docs/python/s... [2] https://radimrehurek.com/gensim/index.html https://radimrehurek.com/gensim/index.html
- nl 11y agoThanks.
- nl 11y agoBTW, your CNN for NLP post is interesting too. You might find LSTM-BASED DEEP LEARNING MODELS FOR NON- FACTOID ANSWER SELECTION[1] (from the IBM Watson team) interesting. They combine a CNN with a LSTM for question answering on complex, non-factoid questions. Their LSTM+Attention model performs slightly better, but it's a pretty interesting approach. [1] http://arxiv.org/abs/1511.04108 http://arxiv.org/abs/1511.04108