# Research on Sentiment Classification of Online Travel Review Text
## 3 Case Study
### Sentiment Classification Experiment
The calculation formula for this is as follows:  
\[Precision=\frac{TP}{TP+FP} \tag{2}\]  
Furthermore, the recall rate refers to the proportion of correct samples classified as positive to actually positive samples, and the calculation formula is as follows:  
\[Recall=\frac{TP}{TP+FN} \tag{3}\]  
Finally, the F1 score is the harmonic average of the precision rate and the recall rate. The calculation formula is as follows:  
\[F1\;score=\frac{2*Precision*Recall}{Precision+Recall} \tag{4}\]  
The accuracy rate reflects the model's ability to distinguish negative samples: the higher the accuracy rate, the stronger the model's ability to distinguish negative samples. Moreover, the recall rate reflects the model's ability to identify positive samples: the higher the recall rate, the stronger the model's ability to recognize positive samples. In addition, the F1 score is the combination of the accuracy rate and recall rate: the higher the F1 score, the more robust the model. While accuracy is the  
Figure 10: The sentiment distribution of the review text of Sydney Opera House, Australia. simplest and most intuitive evaluation index in classification, it is also affected by obvious defects. For example, if we assume that 99% of the samples are positive samples, the classifier could obtain 99% accuracy if it always predicted a positive result, but its actual performance would be very low. That is to say, when the proportion of samples in different categories is highly uneven, the category with the largest proportion often becomes the most important factor affecting the accuracy. As the experimental data in this study was unbalanced data, we did not use the accuracy rate as a classification result evaluation index. Instead, we selected three indicators--accuracy rate, recall rate, and F1 score--to measure the classification results. (4) SVM-based sentiment classification  
Python's sklearn was used to implement the SVM algorithm. After a large number of experiments, the kernel function RBF (Radial Basis Function) was found to achieve the highest classification accuracy, while other parameters were assigned default values. We used 30% of the data as test data and the remaining 70% as training data. The comparative experimental results of one dataset (Mutianyu_Great_Wall) are presented in Table 5. The first row of Table 5 displays the classification results of SVM. The classification accuracy of SVM on this imbalanced dataset is very low, as it assigns most of the samples to the category with the largest number of samples. Once ROS sampling and the Word2 vec vectorization of text is complete, the data in the second row of Table 5 shows that the SVM algorithm's classification result has been greatly improved. The next experiment carried out involves extracting TextRank keywords from the comment text and expand the semantics of the keywords with the largest weights based on the Microsoft Knowledge Graph. The semantic expansion of keywords and pre-processed online travel review text make up the SVM classification dataset. Moreover, the experimental results in the third row of Table 5 list the final classification results; it can be seen from this table that the knowledge graph-based keyword semantic expansion method proposed in this paper optimizes the classification results. Table 6 presents the experimental results of the other three datasets. Similar to the experimental results of the Mutianyu_Great_Wall dataset, it can be seen that the sampling technique, Word2 vec-based text vectorization, and knowledge graph-based keyword semantic expansion method effectively improve the classification effect. Similar experimental results obtained on different datasets verify the universality of this method. In short, this provides an effective solution for sentiment analysis of online travel review texts.