I am trying out my hand at training a Word2Vec model using gensim. I
made a simple training file that basically had just one line repeated
multiple times
entertainment films Movies cinema
entertainment Movies
entertainment films
entertainment cinema
Here you are basically trying to hack Word2Vec to give you the answers you want it to give. Depending on how exactly you create the dataset, this could give results of different quality. But the bigger problem is that when you apply this algorithm to real-life data, the distribution of the data would be very different from what the algorithm was trained on, hence the results may be surprising...
A much better approach would be to gather realistic real-life data and use it to train the algorithm. You always want the training data to be similar to the data that your algorithm will see in prediction time.
The idea behind using a training file like the one above is to ensure
that words like movies, etc come out to be most similar to
entertainment.
But you're not doing this! What Word2Vec does (see also here for nice tutorial) is
The
result is a set of word-vectors where vectors close together in vector
space have similar meanings based on context, and word-vectors distant
to each other have differing meanings. For example, strong
and
powerful
would be close together and strong
and Paris
would be
relatively far.
In your data Movies
, cinema
, and films
are similar because they appear in a similar context, that is, together with entertainment
. On another hand, entertainment
in this dataset is like a stopword in a natural language dataset, same as the
or and
it appears in all kinds of contexts, so it's not similar to anything in particular.
A simple way to learn such algorithm synonyms is to take natural language data and use it to create artificial data with such synonyms. For example, have in your training sample sentences "I went to [cinema] to see the [movie] Casablanca"
and "I went to [movie theater] to see the [film] Casablanca"
, and other combinations. This of course doesn't solve the problem with the word entertainment
, since it's not a synonym. To learn the relation between the words entertainment
and cinema
, gather data where those words appear together, like the movie reviews, press articles from the Arts & Culture category, etc.