| Deep neural network has become the core technology in many fields of artificial intelligence.However,the deep neural network model has problems of poor security and robustness,and the attackers make mistakes in the prediction of its model by malicious adversarial samples,which leads to serious consequence.Sentiment classification is an emerging topic in the field of text data mining,but the current methods of deducing sentence polarity have two major shortcomings: on the one hand,there is currently a lack of a large and well-curated corpus;on the other hand,current solutions based on deep learning are particularly vulnerable to attacks from adversarial samples.Therefore,in view of the above problems,the main work of this thesis is as follows:① This thesis proposes a target-specific sentiment classification adversarial samples defense algorithm based on word-masking data enhancement and adversarial learning.Firstly,the method of masking target-specific entities is used to replace synonyms and insert words randomly.Secondly,this thesis uses the word-masking data enhanced target-specific sentiment classification dataset to train the corresponding sentiment classification model.Finally,this thesis combines data enhancement and adversarial learning to construct a target-specific sentiment classification model.The target-specific sentiment classification algorithm based on word-masking data enhancement and adversarial learning has stronger robustness and higher accuracy.② This thesis proposes a new sentiment classification adversarial training method,which is based on neural network and gradient reversal adversarial samples defense algorithm,the method combines hierarchical neural network and gradient reversal.Firstly,the baseline model is used to extract text feature and feature gradient information.Secondly,the original gradient information is calculated by gradient reversal to obtain the gradient information after inversion.Finally,the original gradient information and the inverted gradient information are fused to obtain a new gradient of the model for adversarial training.The hierarchical neural network and the gradient reversal adversarial training algorithm improve the robustness and accuracy of sentiment classification,and reduce the probability of the model being attacked by adversarial samples.Summary,this thesis proposes two defense algorithms of sentiment classification adversarial samples based on different text attack methods and different sentiment classification baseline models,combined with the principle of adversarial training.The experimental results show that compared with the six baselines(SC),WMDE-AL algorithm improves the Macro-F1 index by 0.90%~2.64%,1.59%~3.09% and0.18%~1.71%,respectively.Aiming at the sentence-level adduction sample defense model,six text adduction sample defense methods were used to compare,and the Boa and Succ indexes of the proposed HNN-GRAT method obtained the optimal values.(For the Deep Word Bug attack,AGNEWS,IMDB and SST-2 datasets.Boa was 41.50%,67.50%,28.15%,and Succ was 55.90%,27.45%,69.89%,respectively.Therefore,the proposed WMDE-AL algorithm and HNN-GRAT algorithm effectively improve the robustness and adversarial defense ability of target-specific sentiment classification and sentence-level sentiment classification models. |