This paper explores the importance of text sentiment analysis and classification in the field of natural language processing, and proposes a new approach to sentiment analysis and classification based on the bidirectional gated recurrent units (GRUs) model. The study firstly analyses the word cloud model of the text with six sentiment labels, and then carries out data preprocessing, including the steps of removing special symbols, punctuation marks, numbers, stop words and non-alphabetic parts. Subsequently, the data set is divided into training set and test set, and through model training and testing, it is found that the accuracy of the validation set is increased from 85% to 93% with training, which is an increase of 8%; at the same time, the loss value of the validation set decreases from 0.7 to 0.1 and tends to be stable, and the model is gradually close to the actual value, which can effectively classify the text emotions. The confusion matrix shows that the accuracy of the model on the test set reaches 94.8%, the precision is 95.9%, the recall is 99.1%, and the F1 score is 97.4%, which proves that the model has good generalisation ability and classification effect. Overall, the study demonstrated an effective method for text sentiment analysis and classification with satisfactory results.
翻译:本文探讨了文本情感分析与分类在自然语言处理领域的重要性,并提出了一种基于双向门控循环单元(GRUs)模型的情感分析与分类新方法。研究首先分析了具有六种情感标签的文本词云模型,随后进行数据预处理,包括去除特殊符号、标点符号、数字、停用词及非字母部分等步骤。接着将数据集划分为训练集与测试集,通过模型训练与测试发现:验证集准确率随训练从85%提升至93%,增幅达8%;同时验证集损失值从0.7下降至0.1并趋于稳定,模型逐渐逼近实际值,能有效实现文本情感分类。混淆矩阵显示模型在测试集上的准确率达到94.8%,精确率为95.9%,召回率为99.1%,F1分数为97.4%,证明模型具有良好的泛化能力与分类效果。总体而言,本研究展示了一种有效的文本情感分析与分类方法,并取得了令人满意的结果。