Consumer reviews represent customer sentiment. They provide valuable insights that businesses can use to improve product or service quality and meet customer needs. Therefore, this research presents an analysis of consumer sentiments towards online shopping using Context-Free Grammar and Deep Learning. It tested the effectiveness of classifying consumer sentiments from 3,600 product or service reviews. The dataset included three types of sentiment categories: Positive, Negative, and Neutral. Context-Free Grammar (CFG) was used to assign term functions as sentiment indicators, and Term Frequency-Inverse Document Frequency (TF-IDF) was used for feature selection. A threshold value was then assigned to each term that represented the sentiment categories. The dataset was divided into 15-fold cross-validation to test the effectiveness of the model before Deep Learning algorithm was used to classify the sentiments. Deep Learning algorithms have the capability to learn complex relationships between terms, allowing for precise sentiment classification. The evaluation showed that using CFG and TF-IDF for term weighting improved the selection of keyword features, leading to significantly more precise sentiment classification. The average Precision, Recall, and F-measure were higher than exclusively using TF-IDF. Moreover, the determination of an appropriate threshold value reduced data complexity without affecting the accuracy of sentiment classification.