# Sentiment-Aware Word Embedding for Emotion Classification
## 3 Methodology
### Constructed Emotional Word Vector Based on the Emotional Lexicon  
After the preprocessing step, every word in each sentence is converted into a vector. The obtained vectors are then compared based on their cosine similarity degree with the vectors of the emotional words. The emotional word vectors with high similarity scores are selected to be combined. The proposal helps to increase the \"semantic power\" of traditional semantic space models for emotional analysis by combining different sources of semantic evidence. The hybrid sentiment-aware word  
Figure 1: Framework for the proposed method. embedding is inputted as the experimental model, showing that two kinds of semantic evidence can complement each other, and the mix of them can identify the correct emotion. The lexicon-based feature extraction method is promising due to the existence of the emotional lexicon. Typically, an emotional lexicon consists of a set of language-specific words, which include information about the emotional category to which it belongs, the polarity intensity, and so on. A fine-grained multi-emotional polarity lexicon can improve the classification accuracy in emotional analysis tasks compared to simple emotional dictionaries [37]. A set of documents and emotional lexicons is given to build the model and generate the emotional word vectors. A corpus, \(D\), consists of a set of texts, \(D=\{d_{1},d_{2}\cdot\cdots,d_{n}\}\), and the vocabulary, \(T=\{t_{1},t_{2}\cdot\cdots,t_{m}\}\), which are unique terms extracted from \(D\). The word representation of the terms \(t_{i}\) are mapped from the Word2 Vec model, and then a set of word representations of all words in the vocabulary is derived, i.e., \(V=\{v_{1},v_{2}\cdot\cdots,v_{m}\}\in\mathbb{R}^{m\times d}\), where \(m\) is the size of the vocabulary, and \(d\) represents the dimensions of the vector space. The core of this method is to construct emotional word vectors representing the emotional information for each word in the vocabulary, but most of them express some emotions that are not typical opinion words, so the paper introduces the lexicon-based method. In order to construct the emotional word vectors, the method utilizes all emotional words in the lexicon as the emotional vocabulary, \(E=[E_{1},E_{2},....E_{k}]\), and gets their word representations, \(V_{E}=\left[V_{E_{1}},V_{E_{2}},\cdots,V_{E_{k}}\right]\). Due to the scale problem of word embedding the model by training the corpus, there is a low degree of the coverage problem, that is, there are some words that are in the emotional vocabulary but not in the vector spaces learned from Word2 Vec. Thus, these words can be ignored and deleted in subsequent processing. The word embedding model captures the semantic relationships in the corpus text, and the contexts of words with the same emotional polarity are identical. Therefore, the similarity between two items is estimated by calculating the cosine similarity between the vectors represented by V and E, that is, \(\text{sim}\left(\text{V},\text{E}\right)=\textit{cosine}\left(\text{V},\text {E}\right)\), defined as  
\[\text{sim}\left(\text{V},\text{E}\right)=\frac{\sum_{i=1}^{d}\left(V_{i}*V_{ E_{i}}\right)}{\sqrt{\sum_{i=1}^{d}V_{i}^{2}*\sum_{i=1}^{d}V_{E_{i}}^{2}}} \tag{1}\]  
where V and E are the vectors of length \(d\). For each item in T, the similarity to all items in E is calculated and then the similarity results are collected into the matrix \(Y\in\mathbb{R}^{m\times k}\), where \(m\) is the length of the text glossary, \(k\) is the length of the emotional vocabulary, and \(Y_{i,j}\) indicates the cosine similarity between the lexical item \(i\) and the emotion \(j\). Based on matrix \(Y\), the top n emotional words, \(E_{w}=\{e_{1},e_{2},\cdots e_{n}\}\), are selected by setting the threshold. For words in \(E_{w}\), they are the nearest neighbors to the item in T as determined by distinguishing their sentimental differences.