# Adaptive Local Context and Syntactic Feature Modeling for Aspect-Based Sentiment Analysis
## 3 Methodology
### Aspect Sentiment Classification Structure
#### 3.2.2 Local Context Focus  
The effective information of aspect terms exists in the local context of the text. The determination of local context includes semantic relative distance methods and methods based on syntactic dependencies. [PERSON] et al. [4] first proposed to apply local context to sentiment classification by using semantic relative distance (SRD) to determine local context. The context-feature dynamic mask strategy and context-feature dynamic weighting strategy are also proposed. Then [PERSON] [5] pointed out that using semantic relative distance to determine local context may make the sentiment words not present in the local context and have a smaller effect on judgmental aspect sentiment. Thus [PERSON] et al. proposed to use the shortest distance between pairs of nodes in the dependent syntactic tree to determine the local context, which can effectively solve this problem. In our study, we found that the length of the review text varied, and the length of each aspect of the local context varied. To address this point, we propose adaptive semantic relative distances (ASRD), which assigns semantic relative distances to each text and determines the local context. In the study, we used the spacy toolkit to generate dependency syntax trees as a way to calculate the semantic relative distances between different words. If the aspect term is a single word, the semantic relative distance is the shortest semantic distance between the two words. If the aspect terms are composed of multiple words, the semantic distance between the input word and the multi-word aspect item is calculated as the average distance between each aspect sub-word and the input word. Figure 3 shows the dependency syntactic tree of the review text. The first review text in Figure 3 is \"The environment of this restaurant is good, the dishes are not very delicious, and the service is very good.\" The aspect terms in the review text are \"environment\", \"dishes\" and \"service\". Take \"environment\" as an example to calculate the semantic relative distance. SRD(environment, good) = 2  
The second review text in Figure 3 is \"It is loaded with programs that are of no good for the average user, that makes it runway to slow.\" The aspect terms in the review text are \"programs\" and \"run\". Take \"programs\" as an example to calculate the semantic relative distance. The corresponding emotional word for \"programs\" is \"no good\". SRD(programs, no) = 4  
Figure 3: Dependency syntactic tree of the review text. SRD(programs, good) = 3 SRD(programs, no good) = 4 If the threshold of SRD takes a smaller value, it may cause the local context of other aspect words to not include their sentiment words. If the threshold of SRD takes a larger value, it may cause other aspect words to contain irrelevant negative sentiment words. To solve this problem, this study proposes adaptive semantic relative distance to select the appropriate SRD for each text, satisfying as much as possible that the local context of each aspect contains its sentiment words and not irrelevant negative sentiment words. In this study, it is observed from the dataset that the length of aspect words is about 3 and the length of text containing a single aspect is 7. Therefore, the original text will be directly used as the local context for the text of length 7. If the text length is more than 7, it is possible that there may be more than one aspect in a text, and therefore the local context needs to be determined. Therefore, two calculation methods are proposed in this study. The first method obtains the maximum shortest distance from each word to the aspect word by depending on the syntactic tree and determines the local context by setting a threshold value.