# Sentiment Analysis of Comment Texts on Online Courses Based on Hierarchical Attention Mechanism
## 4 Experimental Process
### Experimental Setup  
Data sets: The data sets used in this study are two open online course review data sets, namely China University MOOC reviews [32] and MOOC and Ke reviews [25]. China University MOOC is jointly launched by NetEase Youdao and Higher Education Press and carries more than 10,000 open courses and more than 1400 national quality courses. It cooperates with 803 universities and is the largest Chinese MOOC platform [26]. Ke reviews comes from Tencent Classroom. Tencent Classroom is a comprehensive online lifelong learning platform launched by Tencent. It gathers a large number of high-quality educational institutions and famous teachers and offers many online quality courses [25]. Such as vocational training, civil service examination, TOEFL and IELTS, certification and grading examination, oral English, etc. Both MOOC and Tencent Classroom in Chinese universities contain a large number of users and rich classroom reviews. Sentiment analysis of classroom comments can master students' sentiment tendencies and help to carry out targeted classroom improvement, which can improve teaching quality to a certain extent. The MOOC data set contains 11,293 reviews on Chinese online courses from MOOCs, and the affective polarity of the data is divided into positive and negative, with 6164 positive reviews and 5129 negative reviews. MOOC and Ke reviews collected 1808 online course reviews from MOOC and Ke reviews, and the affective polarity of the data set was classified as positive, neutral, and negative. Among them, there are 817 reviews on positive sentiment polarity, 750 reviews on neutral sentiment polarity, and 241 reviews on negative sentiment polarity. In this study, the two data sets were mixed. For the MOOC data set, 80% of them were set as the training set, 10% as the validation set, and 10% as the test set. Due to the small number of MOOC and KE data sets, 80% of them are set as the training set, and the rest are set as the test set. The specific distribution of the two data sets is shown in Table 2. In addition, experiments on the common data set R8 were conducted. The total number of data in R8 is 7674, among which the number of data in the training set is 5482, the number of data in the test set is 2189, and the classification category is 8.  
Evaluation index: Average accuracy is used to measure the performance of the sentiment analysis model of online classroom reviews based on a hierarchical attention mechanism, and F1 is used to evaluate it on MOOC.  
Hyperparameters: We use a single Chinese character as a word. Words are initialized through random vector initialization; the dimension of the word vector is 300, the dimension of the LSTM hidden layer is also set to 300, and the number of LSTM layers is set to 2. The convolution windows of CNN are 2, 3, and 4, and the number of convolution sums is set to 256. For the words not in the dictionary, the values are randomly taken between \(-\)0.1 and 0.1. The initial values of all the parameter matrices and vectors are randomly chosen between \(-\)0.1 and 0.1. The initial value of the bias is set to 0. To adjust the parameters, the optimizer used in this study was Adam, the learning rate was set to 0.01, and the dropout was set to 0.5 to prevent overfitting.