question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use pre trained word2vec vector as input

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BrikerMancommented, Jul 27, 2017

@chsasank I have successfully initialized the weights on embedding with a pre-trained word2Vec model, it works fine. Thanks for your suggestion~

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found