1- The number of features: In terms of neural network model it represents the number of neurons in the projection(hidden) layer. As the projection layer is built upon distributional hypothesis, numerical vector for each word signifies it's relation with its context words.
These features are learnt by the neural network as this is unsupervised method. Each vector has several set of semantic characteristics.
For instance, let's take the classical example, V(King) -V(man) + V(Women) ~ V(Queen)
and each word represented by 300-d vector. V(King)
will have semantic characteristics of Royality, kingdom, masculinity, human in the vector in a certain order. V(man)
will have masculinity, human, work in a certain order. Thus when V(King)-V(Man)
is done, masculinity,human characteristics will get nullified and when added with V(Women)
which having femininity, human characteristics will be added thus resulting in a vector much similar to V(Queen)
. The interesting thing is, these characteristics are encoded in the vector in a certain order so that numerical computations such as addition, subtraction works perfectly. This is due to the nature of unsupervised learning method in neural network.
2- There are two approximation algorithms. Hierarchical softmax
and negative sampling
. When the sample parameter is given, it takes negative sampling. In case of hierarchical softmax, for each word vector its context words are given positive outputs and all other words in vocabulary are given negative outputs. The issue of time complexity is resolved by negative sampling. As in negative sampling, rather than the whole vocabulary, only a sampled part of vocabulary is given negative outputs and the vectors are trained which is so much faster than former method.