With the development of the Internet era,the volume of news data on major platforms continues to surge and is difficult to manage effectively,making it difficult for users to quickly access the information of interest.How to manage and classify the massive amount of news text under the increasingly demanding requirements is a set of topics of practical significance in text tasks.Machine learning-based classification algorithms have long failed to meet the practical needs of current news text classification tasks,and therefore more scholars have focused on relevant models based on deep learning.The capsule network in deep learning has stronger feature learning ability than traditional neural network,but its existing research methods still have some shortcomings,such as the inability to selectively focus on the key words in the text and the lack of coding for the long-distance dependence ability,which largely affect the final classification effect.In response to the above problems,this thesis focuses on optimizing the capsule network feature extraction perspective,and the main research work is as follows:(1)A news text classification model(MA-Caps Nets)based on multi-head attention and parallel capsule networks is designed to address the problems of capsule networks’ inability to selectively focus on key words in news texts and the lack of effective encoding of long-range dependencies.The model encodes the inter-word dependencies and important words in news texts through a multi-head attention mechanism,and then uses a parallel capsule network structure to capture text feature information from different levels for text classification.The experimental results show that MA-Caps Nets achieves better results in news text classification tasks,and the ablation experiments demonstrate the complementary roles of the multi-head attention module and the parallel capsule network structure.(2)In order to further enhance the feature extraction of text by the model,a news text classification model(Bi GRU-MA-Caps Nets)based on Bi GRU and multi-head attention capsule network is designed.In the construction and training of this model,by fusing Bi GRU and multi-head attention mechanism,not only global features in text sequences are effectively captured,but also the importance of words to text is obtained to obtain richer semantic information of text,and then a static routing mechanism is introduced in the capsule network to optimize the capsule network operation process,and a parallel structure is used to capture text feature information from different levels for text classification.The experimental results show that the Bi GRU-MA-Caps Nets have higher metrics and verify the superiority of the model for news text classification tasks.In summary,to verify the effectiveness of the two models proposed above on the news text classification task,quantitative comparison and ablation experiments are conducted in this thesis on two news text datasets.The experiments show that both of the above models improve on the datasets. |