# Topic Word Embedding-Based Methods for Automatically Extracting Main Aspects from Product Reviews
## 3 The Proposed Approaches
### Automatic Generation of Main Aspects from Clean Topics  
To mine main aspects in the collection, we view each of clean topics to an aspect. The next problem is how automatically but yet accurately we can generate an aspect (topic label/title) corresponding to each topic. Please note that labelling each topic is not difficult because the topic is clean (or has a unified meaning) through Algorithm 2. Based on topic information that we can only use, we propose three new methods for detecting main aspects. ```
Input: A collection of text documents \(C\), priors \(\alpha^{*}\), \(\beta^{*}\), and \(m^{*}\); Output: CleanTopics; \(T=\phi\): //\(T\) is a list of topics generated by a topic model; \(T=\text{TopicModel}(C,\alpha,\beta,m^{*})\); //\(\mathbb{V}\) is the space of the word embedding vectors of all topic words; \(\mathbb{V}=\phi\); for(\(\theta_{j}\in T\))do for(\(w_{i}\in\theta_{j}\))do \(\mathbb{V}=f_{\text{ave}}(w_{i})\); \(\mathbb{V}=\mathbb{V}\cup\{f_{\text{ave}}(w_{i})\}\);  end for  end for Clusters = \(\phi\); //Clusters is a list of clusters clustered by DBSCAN;  Clusters = DBSCAN(\(\mathbb{V}\), \(\epsilon\), \(min\)_Pts_);  CleanTopics = \(\phi\); //CleanTopics is a list of clean topics; for(\(\theta_{\{i,j\}}\in\)Clusters )do ifRatio of stop words among topic words in \(\theta_{\{i,j\}}\geq\) 0.9 then  Remove \(\theta_{\{i,j\}}\);  end if elseif\(|\theta_{i}|>>|\theta_{j}|\) in \(\theta_{\{i,j\}}\)then  CleanTopics = CleanTopics \(\cup\{\theta_{i}\}\);  end if elseif\(|\theta_{i}|\sim|\theta_{j}|\) in \(\theta_{\{i,j\}}\)then // The topic \(\theta_{\{i,j\}}\) should be split to \(\theta_{i}\) and \(\theta_{j}\); \(\theta_{i}\longleftarrow\theta_{\{i,j\}}\);  CleanTopics = CleanTopics \(\cup\{\theta_{i},\theta_{j}\}\);  end if  end for // Topics \(\theta_{i}\) and \(\theta_{j}\) should be merged to \(\theta_{\{i,j\}}\); for(\(\theta_{i}\in\) CleanTopics )do for(\(\theta_{j}\in\) CleanTopics)do if\(\theta_{i}\sim\theta_{j}\)then \(\theta_{\{i,j\}}\longleftarrow\theta_{i}\), \(\theta_{j}\);  CleanTopics = CleanTopics \(\cup\{\theta_{\{i,j\}}\}\);  end if  end for  end for
```  
**Algorithm 2**The proposed topic cleaning method  
The first method is based on topic words. As an example, see a topic \(\theta_{i}=\{w_{1}:0.5,w_{2}:0.3,w_{3}:0.2\}\). For each word \(w_{i}\in\theta_{i}\), \(f_{\text{ave}}(w_{i})=v_{w_{i}}\), where \(f_{\text{ave}}\) is the domain-customized word embedding model. In this way, the vectors of all topic words in \(\theta_{i}\) (i.e., \(v_{w_{1}}\), \(v_{w_{2}}\), and \(v_{w_{3}}\)) are created and then projected to the word embedding vector space. Then, a new vector \(v_{*}\) that are the most relevant with \(v_{w_{1}}\), \(v_{w_{2}}\), and \(v_{w_{3}}\) is computed by \(\frac{v_{w_{1}}+v_{w_{2}}+v_{w_{3}}}{|\theta_{i}|}\), where \(|\theta_{i}|\) is the number of vectors in \(\theta_{i}\) and \(+\) is the element-wise addition between vectors. Finally, a vocabulary \(w_{*}\) close to \(v_{*}\) is chosen in the domain-customized word embedding model, where \(w_{*}\) is considered as an aspect explaining \(\theta_{i}\) to the best. In Line 6 of Algorithm 3, \(f_{\text{ave}}^{-1}(v_{*})\) is the inverse of \(f_{\text{ave}}(w_{*})\). The reason why we use the inverse function is that \(w_{*}\) is the closest to \(v_{*}\) when the value of \(f_{\text{ave}}(w_{*})\) is the smallest. ```
Input: A topic \(\theta_{i}=\{w_{1},\dots,w_{l}\}\);  Output: A topic label \(w_{*}\); for(\(w_{i}\in\theta_{i}\))do \(f_{we}(w_{i})=v_{w_{i}}\);  end for\(v_{*}=\frac{v_{w_{1}}+\dots+v_{w_{l}}}{|\theta_{i}|}\); \(w_{*}=f_{we}^{-1}(v_{*})\);
```  
**Algorithm 3**The first aspect auto-generation method  
The second method is based on head words extracted by natural language processing techniques. In the pre-processing step, all text documents in a collection are segmented to a set of sentences. Now, given a topic \(\theta_{i}=\{w_{1}:0.5,w_{2}:0.3,w_{3}:0.2\}\), the goal of the second method is to find the most relevant top-\(k\) sentences.