Domain Generalization for Text Classification with Memory-Based Supervised Contrastive Learning

Qingyu Tan, Ruidan He, Lidong Bing, Hwee Tou Ng


Abstract
While there is much research on cross-domain text classification, most existing approaches focus on one-to-one or many-to-one domain adaptation. In this paper, we tackle the more challenging task of domain generalization, in which domain-invariant representations are learned from multiple source domains, without access to any data from the target domains, and classification decisions are then made on test documents in unseen target domains. We propose a novel framework based on supervised contrastive learning with a memory-saving queue. In this way, we explicitly encourage examples of the same class to be closer and examples of different classes to be further apart in the embedding space. We have conducted extensive experiments on two Amazon review sentiment datasets, and one rumour detection dataset. Experimental results show that our domain generalization method consistently outperforms state-of-the-art domain adaptation methods.
Anthology ID:
2022.coling-1.602
Volume:
Proceedings of the 29th International Conference on Computational Linguistics
Month:
October
Year:
2022
Address:
Gyeongju, Republic of Korea
Venue:
COLING
SIG:
Publisher:
International Committee on Computational Linguistics
Note:
Pages:
6916–6926
Language:
URL:
https://aclanthology.org/2022.coling-1.602
DOI:
Bibkey:
Cite (ACL):
Qingyu Tan, Ruidan He, Lidong Bing, and Hwee Tou Ng. 2022. Domain Generalization for Text Classification with Memory-Based Supervised Contrastive Learning. In Proceedings of the 29th International Conference on Computational Linguistics, pages 6916–6926, Gyeongju, Republic of Korea. International Committee on Computational Linguistics.
Cite (Informal):
Domain Generalization for Text Classification with Memory-Based Supervised Contrastive Learning (Tan et al., COLING 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.coling-1.602.pdf
Code
 tonytan48/mscl