Abstract
Cross domain sentiment analysis is still a difficult task because of vocabulary changes, context change and domain specific sentiment. Conventional models are not known to generalize over unknown areas leading to decreased accuracy and unreliable transfer performance. This paper presents a deep learning model named SentXFormer, which is a transformer-based hybrid framework that enhances the sentiment classification in heterogeneous domains. SentXFormer is based on the hybrid SentiConGRU-Net architecture, which consists of CNN and GRU layers, and contextual embeddings of BERT, RoBERTa, and Domain-Adaptive BERT (DABERT). A domain adaptation module based on an adversarial training with a Gradient Reversal Layer (GRL) also encourages domain-invariant representations to be learned. The experiments are done on 23,440 sentiment-labeled reviews across three publicly available datasets including Amazon (7,550 samples), Yelp (8,450 samples), and IMDB (7,440 samples). SentXFormer performed well in in-domain, reaching 98.7% (Amazon), 97.67% (Yelp) and 98.8% (IMDB) accuracies. The model is stable in terms of transferability in cross-domain settings with an accuracy of 91-93% on all train-test combinations. The comparative analysis with LSTM, CNN, GRU, and latest transformer-based adaptation models demonstrates that SentXFormer is always better than the current baselines. The findings indicate that SentXFormer is an efficient, strong and scalable tool to sentiment analysis in heterogeneous and real-life customer review contexts.