# Detecting Fake Reviews Using Aspect-Based Sentiment Analysis and Graph Convolutional Networks
## 4 Methodology
### Graph Construction  
Next, we construct a graph using Spacy's dependency-parsing capabilities. These include part-of-speech (POS) tagging and lemmatization. One graph is created for each review, starting with the dependency tree. In this graph, the nodes represent tokens. Edges are added between nodes if the tokens have a semantic dependency, creating an undirected graph, \(D_{ij}=D_{ji}\). This relationship is encoded in an adjacency matrix \(A\), where \(A_{ij}=D_{ij}=1\) if there is a dependency between \(w_{i}\) and \(w_{j}\), and 0 otherwise.  
The adjacency matrix is then converted into a weighted adjacency matrix. This weighted matrix incorporates information about the aspect terms and their corresponding sentiments in the review text. If a term is a noun, we consider it a possible aspect and increase the weight of its connections. Additionally, we assign a sentiment score between \(-1\) and \(1\) to each token based on SenticNet7 [18]. SenticNet7 is an artificial intelligence (AI) framework designed to improve sentiment analysis by using commonsense reasoning. It helps better interpret emotions in the text by applying a structured, knowledge-based approach. The weights are determined as follows:  
\[T_{ij}=1\text{ if either word }(w_{i})\text{or }(w_{i})\text{ is a noun, else 0}\]  
Figure 3: Model architecture of FakeDetectionGCN.  
\[S_{ij}=\text{SenticNet}(w_{i})+\text{SenticNet}(w_{j})\]  
The final weights are computed, and the adjacency matrix is updated using the formula in [10]:  
\[A_{ij}=D_{ij}\times(S_{ij}+T_{ij}+1) \tag{1}\]  
where \(D_{ij}\) indicates the presence of a semantic or syntactic dependency, \(S_{ij}\) is the sum of sentiment scores of the words, and \(T_{ij}\) increases the weight if either word is a noun.  
Essentially, the affective \(S_{ij}\) scores detect unnatural sentiment shifts between a pair of words, a key trait of fake reviews. The \(T_{ij}\) score's intuition is that if the word is a noun it is more likely to be an aspect word, thus aspect-related words influence the graph learning process. Equation (1) increases the weight of the existing dependency edges; the plus one makes the term inside the parenthesis always bigger than 1 and does not diminish the dependency edges.  
Algorithm 1 shows how the weighted adjacency matrix is computed. The time complexity of the algorithm is \(O(n^{2})\), given that we precomputed and saved the SenticNet scores and the information on whether a word is a noun or not. The total time for all graphs is \(O(kn^{2})\).  
```
1:Input: Plain Text Review
2:Output: Weighted adjacency matrix \(A\)
3: Initialize graph \(G\) with empty nodes and edges
4: Parse the text input using Spacy to obtain tokens with their POS tags and dependency relations
5:for each token \(t_{i}\) in the parsed document do
6: Add token \(t_{i}\) as a node in graph \(G\)
7:for each dependency from token \(t_{i}\) to token \(t_{j}\)do
8: Add an undirected edge between node \(t_{i}\) and node \(t_{j}\) in graph \(G\)
9: Initialize adjacency matrix \(A\) with dimensions equal to the number of tokens, set all entries to 0
10:for each edge \((t_{i},t_{j})\) in graph \(G\)do
11: Set \(A[i][j]=1\) and \(A[j][i]=1\)
12: Transform \(A\) into a weighted adjacency matrix:
13:for each pair of tokens \((t_{i},t_{j})\) connected in \(A\)do
14:if either \(t_{i}\) or \(t_{j}\) is a noun then
15:\(T_{ij}=1\)
16:else
17:\(T_{ij}=0\)
18:\(S_{ij}=\text{SenticNet}(t_{i})+\text{SenticNet}(t_{j})\)
19:\(A[i][j]=A[j][i]=A[i][j]\times(S_{ij}+T_{ij}+1)\)
20:return the weighted adjacency matrix \(A\)
```  
**Algorithm 1** Construct Weighted Adjacency Matrix