Research on TextCNN Model Optimization and Performance Enhancement for Text Classification
A solution based on attention mechanism was proposed to address the issue of insuffi-cient capturing of key information by the TextCNN model,which affects the classification ac-curacy.Multiple-scale convolutional kernels were employed to capture features of different granularities in the text,thereby enhancing the classification accuracy.Subsequently,dropout was applied to the attention-weighted output.Through this approach,dropout could reduce the ex-cessive influence of specific parts on the final output while retaining attention information,thus improving the models generalization ability.Experimental results demonstrate that the improved TextCNN model achieved an accuracy of 92.27%,precision of 92.32%,recall of 92.27%,and Fl score of 92.28%in text classification,surpassing the original TextCNN,TextRNN and Tex-tRNN-attention models.Moreover,performance metrics for each category were also enhanced.