Mathematics behind the word2vec model