Aspect-level sentiment classification aims to predict the sentiment polarities towards the target aspects given in sentences. To address the issues of insufficient semantic information extraction and high computational complexity of attention mechanisms in existing aspect-level sentiment classification models based on deep learning, a contextual graph attention network (CGAT) is proposed. The proposed model adopts two graph attention networks to aggregate syntactic structure information into target aspects and employs a contextual attention network to extract semantic information in sentence-aspect sequences, aiming to generate aspect-sensitive text features. In addition, a syntactic attention mechanism based on syntactic relative distance is proposed, and the Gaussian function is cleverly introduced as a syntactic weight function, which can reduce computational complexities and effectively highlight the words related to aspects in syntax. Experiments on three public sentiment datasets show that the proposed model can make better use of semantic information and syntactic structure information to improve the accuracy of sentiment classification.