KNN-Attention-CNN Model for Text Emotion Classification

Jiayi Han, Jianwei Liu, Xiong-Lin Luo · 2021

Convolutional Neural Network (CNN) shows superior performance in the field of emotion classification, but existing approaches input single text matrix to CNN, which are the lack of considering similar texts in training dataset, and effect on the overall classification performance. In this paper, we put forward a kind of combining KNN algorithm which is used to extract the weighted text matrices, self-attention mechanism to obtain the fusion attention text matrices, and CNN text emotion classification model, and we dub it KNN-Attention-CNN. First, KNN algorithm is used in the pre-processing part to extract the similar features of training text dataset and obtain the weighted text matrix. Then the self-attention mechanism is introduced to extract the emotional features with the remote dependence relationship, and finally the classification of the emotional features is implemented through the convolutional neural network. The experimental results are conducted on three real data sets show that the proposed KNN-Attention-CNN model are superior to ordinary CNN, and the accuracy is 3.12% higher than CNN. The comparison between KNN-Attention-CNN and five other baseline models verifies the promising performance of KNN-Attention-CNN. We change the length of the input sentences and K value in KNN algorithm respectively, affirm that the addition of the self-attention mechanism has a more obvious effect on the emotional classification on long sentences, and the appropriate K value can optimize the classification performance.

Read the paper · More papers on PaperTik