hiyouga / Dual-Contrastive-Learning

Code for our paper "Dual Contrastive Learning: Text Classification via Label-Aware Data Augmentation"
https://arxiv.org/abs/2201.08702
MIT License
156 stars 28 forks source link

For the labels containing multiple words, How to take the mean-pooling? #11

Open TianlinZhang668 opened 2 years ago

TianlinZhang668 commented 2 years ago

For the labels containing multiple words, How to take the mean-pooling? Is there this code in files?

hiyouga commented 2 years ago

There are two approaches to tackling this problem. We can take the mean-pooling on the BERT outputs to obtain the label representations. Alternatively, we can also take the first word in the label if it does not conflict with other labels.