Use pre trained word2vec vector as input
See original GitHub issueI am trying to use word2vec vector as input.
this is the original input
1 ['我', '想', '看', '电影']
2 ['有', '没有', '美剧']
...
9999 ['有', '没有', '美剧']
replace words with the vector
1 [[word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200]]
2 [[word2vec size=200], [word2vec size=200], [word2vec size=200]]
...
9999 [[word2vec size=200], [word2vec size=200], [word2vec size=200]]
pan the vectors with np.zeros.
1 [[word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200]]
2 [[word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200]]
....
9999 [[word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200], [word2vec size=200]]
Then use the result as input. Is this doable? and how should I do that? Thanks a lot.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
How to use pre trained word2vec model? - Cross Validated
In Python, you can use Gensim import gensim model = gensim.models.Word2Vec.load_word2vec_format('path-to-vectors.txt', binary=False) # if ...
Read more >Pretrained Word Embeddings | Word Embedding NLP
Word2Vec is one of the most popular pretrained word embeddings developed by Google. Word2Vec is trained on the Google News dataset (about 100 ......
Read more >How to load a pre-trained Word2vec MODEL File and reuse it?
Use KeyedVectors to load the pre-trained model. from gensim.models import KeyedVectors from gensim import models word2vec_path ...
Read more >Using pre-trained word embeddings - Keras
In this example, we show how to train a text classification model that uses pre-trained word embeddings. We'll work with the Newsgroup20 dataset ......
Read more >Word Embedding and Word2Vec Model with Example - Guru99
1. The first Step to implement any machine learning model or implementing natural language processing is data collection 2. It is very important...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alepacheco https://eliyar.biz/using-pre-trained-gensim-word2vector-in-a-keras-model-and-visualizing/ here
@chsasank I have successfully initialized the weights on embedding with a pre-trained word2Vec model, it works fine. Thanks for your suggestion~