princeton-nlp / c-sts

[EMNLP 2023] C-STS: Conditional Semantic Textual Similarity
65 stars 6 forks source link

The way to generate positive and negative pairs in Quad loss. #6

Open HungryFlo opened 4 months ago

HungryFlo commented 4 months ago

Thanks for your kind contribution. When I read 'modeling_encoders,py', I cannot understand the way to generate positive pairs and negative pairs in Quad loss. For example, in class BiEncoderForClassification:

positives1, negatives1 = torch.split(features_1, bsz // 2, dim=0) 
positives2, negatives2 = torch.split(features_2, bsz // 2, dim=0)

Does this mean that the batch size must be 2 to make a batch of data only include the same pair of sentences with different conditions?