I've been feeling a lot of places all the time. Word embedding and Word2vec mixed together to say, so the difference between the two is not very clear.
In fact, Word embedding contains a Word2vec,word2vec word embedding, which is a vector representation of words.
1. The simplest word embedding is the word One-hot expression based on the word bag (BOW) . This way, the words in the glossary in a column, for a word a, if it appears in the above word sequence in the position of K, then its vector representation is "K-bit 1, the other position is 0" a vector. However, this representation does not learn the relationship between words (location, semantics), and if there are many words in the document, the word vectors can be very long. For these two problems, the first problem is ngram, but the calculation is very large, the second problem can be solved by the co-existing matrix (cocurrencematrix), but still facing the dimension disaster, so we need to reduce dimension.
2. The more commonly used method now is to use Word2vec to train vocabulary and to express words in vectors. The model involves two kinds of algorithms:Cbow and Skip-gram.
Cbow is a given context to predict the central word, Skip-gram is the context by which the central word is predicted, and the neural networks used for both require only a layer of hidden layers.
Their approach is to:
Cbow:
Use a word in the context of a word as input, and the word itself as output, that is, to see a context, hoping to guess the word and its meaning. By training in a large corpus, a weight model is obtained from the input layer to the hidden layer. As shown, the context word for the first L Word is i,j,k, then i,j,k as input, and the value of the position in the glossary where they reside is set to 1. Then, the output is L, and the value of the position in the glossary where it is located is set to 1. Once the training is done, the weights of each dimension of each word to the hidden layer are given, which is the vector of each word.
Skip-gram
The word in the context in which a word is located is the output, and that word itself as input, that is, to give a word that expects to predict the context in which it might appear. By training in a large corpus, a weight model is obtained from the input layer to the hidden layer. As shown, the context word for the first L Word is i,j,k, then i,j,k as output, the value of the position in the glossary where they reside is set to 1. Then, the input is L, and the value of the position in the glossary where it is located is set to 1. Once the training is done, the weights of each dimension of each word to the hidden layer are given, which is the vector of each word.
Specific details in the learning process feel the user's blog https://www.cnblogs.com/pinard/p/7243513.html written very well.
For my understanding above, if it helps, I'd like to have a ~~~~~~.
Word Embedding Understand