Pre-training language models on large-scale public corpora and finetuning the pre-trained language model on natural language processing subtasks has become a common training paradigm.However,both the biases learned by the language model during pre-training and the imbalanced data distribution that may occur in the downstream task training set can lead to a situation where the model’s inference accuracy on the test set meets the criteria,but the model’s performance in practical applications may not meet expectations,i.e.,the model lacks generalization ability.The suspicious associations learned during the model training process are one of the reasons for the above phenomenon,while causal inference can establish stable causal relationships between tasks and goals.At the same time,fine-grained sentiment analysis,as an important and challenging subtask in text sentiment analysis,plays an important role in several scenarios such as public opinion analysis,search,personalized recommendation,content safety,and dialogue systems.Inspired by this,this thesis integrates causal inference into existing fine-grained sentiment analysis algorithms and applies it to classification and generation tasks for validation.This thesis presents the design and implementation of a fine-grained sentiment analysis algorithm based on causal inference techniques.In the classification task,a Counterfactual Aspect Category Sentiment Analysis(CF-ACSA)framework is proposed,which identifies suspicious correlated attribute items in various sentiment tendencies corresponding to the finetuning task training dataset based on a semi-supervised approach and constructs counterfactual samples.Intervention is performed on the scores of counterfactual samples and original samples corresponding to their respective sentiment tendencies to obtain a de-biased inference result.In the generation task,the CF-ACSA framework is applied to the dialogue emotion generation task to identify emotions implied in the dialogue context and store the user’s emotional memory.In multi-turn dialogues,the user’s emotional memory is accurately retrieved and combined with the context to generate responses containing the corresponding emotions,endowing the dialogue robot with empathetic ability.Based on these two algorithmic innovations,a causal inference algorithm platform is built,which provides a user interactive page for convenient use of dataset preprocessing,dataset management,causal graph generation,causal graph visualization,and causal analysis functions.The proposed algorithm is validated on the publicly available datasets ASAP and DuLeMon,and the experimental results of both automatic evaluation metrics and manual evaluation metrics demonstrate that the proposed algorithm in this thesis has a better performance compared to the baseline algorithms on the public datasets.At the same time,the experiments also validate that the algorithm can adapt to different types of language models in encoder,decoder,and encoder-decoder architectures. |