# Understanding Training Word Embeddings?

I am new to Natural Language Processing. I am trying to understand how word embeddings are created.

1. When we are training Neural Networks, it is usuallly the weights of the neural network that are changed. So for when we are training in a mechanism like auto-encoders (which according to me is: given an input sequence "stackoverflow community is great" will try to predict "stackoverflow community is great". To do this the weights of the neural network is trained.

2. Now if only the weights of the neural network is trained, how exactly do we obtain the word embeddings (that is how do we get vectors for words, so that we can do things like King-Queen+Woman=Man or something similar. How exactly are we getting the word vectors if we are only changing neural network weights and not the input vector components).

Some resources I have looked at:

Equivalently and more space-efficiently, you can provide a numerical index to select the row with the word's embedding, rather than the one-hot vector. The multiplication route says that we multiply the embedding matrix W by [0 1 0 0 0]; the indexing route says that we select the row W[2] instead.
Either way, all of the embeddings are stored in that matrix W which is a parameter of the model. There is one row for each word in the model's vocabulary.