Take you through the Word2Vec training process hand in hand

Since this shift cannot be played, paste the link to the word document
https://pan.baidu.com/s/1mMEWk1_v31s_AfJPAwgsYQ Extraction code: d6vm
Word2Vec is the most basic content in natural language processing, which may not be for beginners How to understand. I have learned this content on and off several times, and I have gained a lot each time. I almost understand it now, so I will express it completely for beginners to learn. I hope it can help everyone.

Training data acquisition

You may have heard that Word2Vec has two models: Cbow and Skip-gram. In fact, this is not used during training. This is a method of selecting input and output. Next, I will introduce these two methods first.
There is a bit of preliminary work before introducing these two methods :

Insert picture description here
Cbow model :
Insert picture description here
Skip-gram model : The
Skip-gram model is opposite to the Cbow model. The model constructed according to its method is (3,1),(3,2),(3,4),(3,1).

Training process

Since the formula is difficult to type, I will directly paste the image, I will put it in the link below, you can directly read my word
Insert picture description here
Seeing the above is actually not very clear. Next, I will show you the trained model. After reading it, I believe you will have a deeper understanding:
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Negative sampling

Insert picture description here
Insert picture description here
As for why I did this, I don’t know. You can consider reading the paper. "DisTribution Representations of Words and Phrases and Their Compositionality" (Mikolov et al. 2013)

Link: link .

Guess you like

Origin blog.csdn.net/qq_39158406/article/details/105167222