# Aspect Sentiment Triplet Extraction Based on Deep Relationship Enhancement Networks
## 3 Model Building
### Information Extraction and Fusion Layer  
Secondly, to fully exploit other information beyond semantics, this paper incorporated part-of-speech information, dependency syntactic information, relative position information, and tree distance information to broaden the expression of the semantic vector space and enrich vector representation. So, it could improve the accuracy of entity recognition, contributing to the improved judgment of relationships between words. The part-of-speech information, dependency syntactic information, relative position information, and tree distance information used in this paper are all provided in the dataset and are represented, respectively, as \(G_{pos}=[g_{1},g_{2},\cdots g_{n}]\in\mathbb{R}^{n\times n\times d_{g}}\), \(G_{dependency}=[g_{1},g_{2},\cdots g_{n}]\in\mathbb{R}^{n\times n\times d_{g}}\), \(G_{position}=[g_{1},g_{2},\cdots g_{n}]\in\mathbb{R}^{n\times n\times d_{g}}\), and \(G_{distance}=[g_{1},g_{2},\cdots g_{n}]\in\mathbb{R}^{n\times n\times d_{g}}\) through random initialization. After obtaining \(G\), \(G_{pos}\),\(G_{dependency}\), \(G_{position}\), and \(G_{distance}\), this paper first adds and subtracts matrices and normalizes them through \(SoftMax\) to integrate matrix rep resentations and find differences between matrices, and it fully integrates this information and strengthens the relationships between words, as shown in Formulas (6) and (7).  
\[G_{add}=softmax\Big{(}\ G+G_{pos}+G_{depency}+G_{position}+G_{distance}\Big{)} \tag{6}\]  
\[G_{sub}=softmax\Big{(}G-G_{pos}-G_{depency}-G_{position}-G_{distance}\Big{)} \tag{7}\]  
To address the issue of discontinuity between aspect words and opinion words in ABSA, this paper introduces a multiscale global network attention mechanism designed to link discontinuous words. The multiscale global network attention mechanism was initially introduced to mitigate redundancy in global attention modules in image processing [28]. [PERSON] et al. [28] asserts that attention mechanisms across different distances also prove effective at addressing different distance of pixels. We think that it could also process the discontinuity between the aspect words and opinion words. The structure of the SWDA is shown in Figure 2.  
For \(G_{add}\), when the scale \(r=1\), after the SWDA, Formula (8) is as follows.  
\[X_{1}=SWDA(Q,K,V,r=1) \tag{8}\]  
Among them, \(Q\), \(K\), and \(V\) are matrices of query, key, and value. They were the three feature matrices obtained by \(G_{add}\) through CNN, and each row of these three matrices represented a query/key/value feature vector. For the query at position \((i,j)\), in the original feature mapping, the SWDA sparsely selected keys and values, with \((i,j)\) as the center, to perform the attention mechanism in sliding windows of different sizes, as shown in Formula (9).  
\[X_{i,j}=softmax(\frac{q_{ij}X_{r}^{T}}{\sqrt{d_{k}}})V,\ 1\leq i\leq W,\ 1\leq j\leq H \tag{9}\]  
\(W\) and \(H\) are the height and width of the feature map at position \(X_{i,j}\). For position \((i,j)\), the width and height have a certain limit range:  
\[\big{\{}\big{(}i^{\prime}+j^{\prime}\big{)}\big{|}i^{\prime}=i+p\times r,j^{ \prime}=j+p\times r\big{\}}\quad-1<=p.\ q<=1 \tag{10}\]  
Similarly, when \(r=3\), \(X_{3}\) is obtained, \(X_{1}\) and \(X_{3}\) are then spliced after passing through the linear layer. And \(X_{add}\) is finally obtained. \(X_{sub}\) is similarly obtained. In order to better  
Figure 2: Structure of SWDA.  
capture the relationships between words, the loss calculation used in this paper for \(G,X_{add}\) and \(X_{sub}\) consists of two parts, namely \(L\), \(L_{add}\) and \(L_{sub}\), as shown in Formula (5).  
\[L=L^{\beta}+\alpha L^{add}+\beta L^{sub} \tag{11}\]