<p>The word2vec algorithm itself is what incrementally learns the real-valued vector, with varied dimension values. </p>

<p>In contrast to the one-hot encoding, these vectors are often called "dense embeddings". They're "dense" because unlike the one-hot encoding, which is "sparse" with many dimensions and mostly zero values, they have fewer dimensions and (usually) no zero-values. They're an "embedding" because they've "embed" a discrete set-of-words into another continuous-coordinate-system.</p>

<p>You'd want to read the <a href="https://arxiv.org/abs/1301.3781" rel="nofollow noreferrer">original word2vec paper</a> for a full formal description of how the dense embeddings are made. </p>

<p>But the gist is that the dense vectors start totally random, and so at first the algorithm's internal neural network is useless for predicting neighboring words. But each (context)->(target) word training example from a text corpus is tried against the network, and each time the difference from the desired prediction is used to apply a tiny nudge, towards a better prediction, to both word-vector and internal-network-weight values. </p>

<p>Repeated many times, initially with larger nudges (higher learning-rate) then with ever-smaller nudges, the dense vectors rearrange their coordinates from their initial randomness to a useful relative-arrangement – one that's about-as-good as possible for predicting the training text, given the limits of the model itself. (That is, any further nudge that improves predictions on some examples, worsens it on others – so you might as well consider training done.)</p>

<p>You then read the resulting dense embedding real-valued vectors out of the model, and use them for purposes other than just nearby-word prediction.  </p>
How to calculate a One-Hot Encoding value into a real-valued vector?
<p>In Word2Vec, i've learned that both of CBOW and Skip-gram produce a one-hot encoding value to create a vector (cmiiw), I wonder how to calculate or represents a One-Hot Encoding value into a real-valued vector, for example (source: <a href="http://blog.districtdatalabs.com/nlp-research-lab-part-1-distributed-representations" rel="nofollow noreferrer">DistrictDataLab's Blog about Distributed Representations</a>)
from this:
<img src="https://s1.postimg.org/naavbr5lr/Lev_Konstantinovskiy_Next_generation_of_word_embeddings_in_Gensim_2.jpg" alt="One-Hot Encoding&#39;s example">
into:
<img src="https://s1.postimg.org/734kvoylb/Lev_Konstantinovskiy_Next_generation_of_word_embeddings_in_Gensim_2.jpg" alt="One-Hot Encoding&#39;s example">
please help, I was struggling on finding this information.</p>