# JUMRv1: A Sentiment Analysis Dataset for Movie Recommendation
## 4 Methods and Materials
### Word Embedding  
Word embedding is a method of representing words in a low-dimensional space, most commonly in the form of real-valued vectors. It allows words with similar meaning and related semantics to be represented closer to each other than less related words. Word embeddings help attach features to all words, depending on their usage in the corpus. In other words, the purpose of word embeddings is to capture inter-word semantics. Figure 2 shows a typical word embedding. While working on JUMRv1, we dealt with two different approaches to word embeddings, namely Word2 Vec and GloVe. **Word2 Vec:** This is a two-layer NN that vectorises words, hence creating a word embedding. This method works by initialising a random word with a random vector value. It then trains the word according to its neighbouring words in the corpus. Word2 Vec models can be customised to have a wide range of vocabularies, a large number of features as well as embedding types. There are also some pre-trained Word2 vec models, accessible via open sources ([[https://towardsdatascience.com/the-three-main-branches-of-word-embeddings-7b90](https://towardsdatascience.com/the-three-main-branches-of-word-embeddings-7b90) fa36 dfb9]([https://towardsdatascience.com/the-three-main-branches-of-word-embeddings-7b90](https://towardsdatascience.com/the-three-main-branches-of-word-embeddings-7b90) fa36 dfb9)). **GloVe:** GloVe stands for Global Vectors and refers to a method of vectorising all the words given in a corpus while considering global as well as local semantics, unlike Word2 Vec, which only takes care of local semantics. This method counts the total number of times one word co-occurs with another word with the use of a co-occurrence matrix; the resultant embedding is made on the basis of relative probabilities. Figure 2: Example of a simple word embedding on a 2D plane, with words taken from the Wikipedia definition of “word embedding” ([[https://towardsdatascience.com/visualization-of-word-embedding-vectors-using-gensim-and-pca-8f592](https://towardsdatascience.com/visualization-of-word-embedding-vectors-using-gensim-and-pca-8f592)]([https://towardsdatascience.com/visualization-of-word-embedding-vectors-using-gensim-and-pca-8f592](https://towardsdatascience.com/visualization-of-word-embedding-vectors-using-gensim-and-pca-8f592)) a5d3354). In this study, we used four different types of word embeddings, three of which are Word2 Vec types and one is of the GloVe type. These are the following:  
1. Google Pre-trained Word2 Vec: This is a Word2 Vec model, trained by Google on a 100-billion-word Google News dataset and accessed via the gensim library ([PERSON] et al. [31]);
2. Custom Word2 vec (Skipgram): Here, a custom Word2 Vec model that uses \"skipgram\" neural embedding method is considered. This method relates the central word to the neighbouring words;
3. Custom Word2 Vec (Continuous Bag Of Words): Another custom Word2 Vec model that uses the Continuous Bag Of Words (CBOW) neural embedding method. This is the opposite of the skipgram model, as this relates the neighbouring words to the central word;
4. Stanford University GloVe Pre-trained: This is a GloVe model, trained using Wikipedia 2014 ([PERSON] et al. [32]) as a corpus by Stanford University, and can be accessed via the university website. Among these, the first three are Word2 Vec-type embeddings and the fourth is a GloVe embedding. Word2 Vec embeddings have a neural network that can train itself with two learning models: CBOW and Skipgram. **CBOW:** In this method, the representations of the neighbouring (context) words are fed to the NN to predict the word in the middle. The vectors of the context words form the vector of the word in the middle. Error vectors are formed and the individual weights are averaged before passing each word through the softmax layer. **Skipgram:** Here, the exact opposite route is taken. The word in the middle is fed to the NN. Error vectors are formed with all words that could possibly be next.