A domain-adaptive sentiment analysis method integrating attentional mechanisms and adversarial training
摘要
Domain-adaptive sentiment analysis utilizes the source domain to annotate the target domain. Using Bidirectional Encoder Representations from Transformers (BERT) directly and its extended models cannot well solve the challenges in feature selection and sample selection bias in the domain faced by the inter-domain transfer model, resulting in poor inference performance. Therefore, this paper proposes a domain-adaptive sentiment analysis method (Incorporating Attention Mechanisms and Adversarial Training, IAMT) that integrates an attention mechanism with adversarial training. Firstly, by incorporating both the dual-axis and multi-head attention, we construct a model capable of capturing local features while addressing cross-domain global dependencies, alleviating the problem of inter-domain feature selection. Secondly, adversarial training is employed to dynamically adjust sample weights in the source domain, mitigating the issue of sample selection bias. Experiments on SemEval and Twitter datasets show the method achieves a 16.31% improvement over the baseline model’s mean macro F1 score and a 0.0156 decrease in maximum mean discrepancy (MMD).