0
$\begingroup$

As we know Word2Vec is non-contextual embedding (at word level). As per my knowledge, BOW is statistical embedding technique (word level).

we can perform Word2Vec embedding in two approaches: 1. CBOW. 2. Skip-gram analysis

am confused with BoW and CBoW as both methods output is numerical/continuous vector. then what is difference between these two?

and can you please share the more insights about CBoW and Skip-gram architecture/implementation?

$\endgroup$

1 Answer 1

0
$\begingroup$

Bag of words(BOW) is a term generally used for the assumption where one doesn"t care about the order of the words. Words are usually treated as a set instead of a sequence. So BOW is not really a statastical embedding technique. There are lot of stastical embedding techniques like multi hot vectorization, TF-IDF vectorization which treat documents as a set of terms hence make BOW assumption. Order of term doesn"t matter here just their presence or absence.

CBOW/skipgram are techniques used in word2vec to generate pseudo-corpus(input/output examples) out of real corpus(text).

Goal of word2vec is to generate good embeddings for the words. For that we need to leverage the neighbourhood of the words. Words with similar neighbourhood ends up having similar embeddings(word vectors). To do this we frame the problem as a neighbourhood/context prediction problem. While training itself for that purpose the model ends up generating good embeddings as a side-effect.

In skipgram problem is to find context word(falling in n radius) given a center word.

In cbow we frame the problem as: Predict center word given preceding and succeeding n words where n is window radius.

So for a sentence:

"John loves icecream made in Italy."

skipgram will create input/output training examples as follows:

icecream -> John
icecream -> loves
icecream -> made
icecream -> in

cbow will create training input/outputs as follows:

{John, loves, made, in} -> icecream

As seen above for same example skipgram generates more training examples. That"s the reason it is preferred over cbow in case of small data corpus.

However when data is huge cbow is prefered as it generate semantically crisp embedding of words with large overlapping neighbourhoods.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.