# Local Dependency-Enhanced Graph Convolutional Network for Aspect-Based Sentiment Analysis
## 3 Proposed Approach/ Methodology
### Ldegcn
#### 3.4.3 Local Context Weight  
Dependency syntactic structure can reveal the semantic modification relationships between different constituents of a sentence, enabling it to capture collocational information over long distances. The dependency graph constructed through dependency syntactic trees allows for the effective acquisition of long-distance dependencies among various words in a sentence. According to the literature [27], the sentiment polarity of aspects is primarily influenced by the surrounding contexts. As the distance between the context and the aspect increases, the correlation gradually weakens. This characteristic was not effectively addressed in previous works. Hence, the LCW method was introduced for improved handling of long-distance dependencies. This method assigns higher weights to words in close proximity while reducing the weights of words farther away. This guides the model to focus more on local correlations, enhancing its performance in addressing long-distance dependency issues.  
The LCW method constructs a local context-weighted adjacency matrix and leverages the dependency parse tree to calculate the syntactic distance (\(SD\)) between contexts and aspects in order to assign position weights. The syntactic distances from contexts to different aspects are illustrated in Figures 3 and 4. Formally, the weight of dependency (\(w_{i},w_{j}\)) can be defined as follows:  
\[W_{i,j}=\begin{cases}1-\frac{d_{i}+d_{j}}{2n}&d_{i}\text{ and }d_{j}\text{ exist}\\ 0&\text{no connection}\end{cases} \tag{13}\]  
where \(d_{i}\), \(d_{j}\) represent the syntactic distance in the dependency tree from the \(i\)-th word and the \(j\)-th word to the given aspect, respectively, and \(n\) represents the length of the current sentence.  
\[G_{i,j}=U_{i,j}*W_{i,j} \tag{14}\]  
Figure 4: The positional relationship of the aspect “food” in dependency tree (The number on each word represents the \(SD\) to the aspect “food”).  
Figure 3: The positional relationship of the aspect “environment” in dependency tree (The number on each word represents the \(SD\) to the aspect “environment”).  
The dependency graph enhanced by LCW not only incorporates the syntactic information of the context but also effectively filters out noise caused by irrelevant information to the aspect. Based on the enhanced graph, the multi-layer GCN facilitates the efficient fusion of global information and local sentiment details. Algorithm 1 provides an overview of the procedure for generating the dependency-enhanced matrix for each sentence:  
```
0: a sentence, \(W^{c}=\{w_{1}^{c},w_{2}^{c},\ldots,w_{a+1}^{c},\ldots,w_{a+m}^{c},\ldots,w_{n}^{c}\}\); aspect sequence, \(W^{a}=\{w_{1}^{a},w_{2}^{a},\ldots,w_{n}^{a}\}\); the dependency tree of the sentence, \(dependency(W^{d})\); intensity scores from SenticNet; a specific dependency set, \(S_{set}\); syntax distance, \(SD=\{d_{1},d_{2},\ldots,d_{n}\}\)
1:for i = 1 \(\rightarrow\) n do
2:for j = 1 \(\rightarrow\) n do
3:if dependency\((w_{i},w_{j})\in dependency(W^{d})\) or \(i=j\)then
4:\(D_{i,j}\gets 1\)\(\
abla\)Generated by dependency tree
5:\(I_{ij}\leftarrow\left|Intensity(w_{i})\right|+\left|Intensity(w_{j})\right|\)\(\
abla\)Enhanced by SenticNet
6:if\(w_{i}^{c}\) or \(w_{j}^{c}\in W^{a}\)then
7:\(A_{i,j}\gets 1\)
8:if\(R_{ij}\in S_{set}\)then
9:\(T_{i,j}\gets 1\)\(\
abla\)Enhanced by dependency type
10:else
11:\(T_{i,j}\gets 0\)
12:endif
13:else
14:\(A_{i,j}\gets 0\)
15:endif
16:else
17:\(D_{i,j}\gets 0\)
18:endif
19:\(U_{i,j}\gets D_{i,j}\times(I_{ij}+A_{ij}+T_{i,j}+1)\)
20:\(W_{i,j}\gets 1-\frac{d_{i}+d_{j}}{2n}\)\(\
abla\)Calculating weight matrix(W)
21:\(G_{i,j}\gets U_{i,j}\times W_{i,j}\)
22:endfor
23:endfor
```  
**Algorithm 1** The process of generating a dependency-enhanced matrix.