semantic-text-similarity icon indicating copy to clipboard operation
semantic-text-similarity copied to clipboard

problem when swapped sentences

Open ZeinabAghahadi opened this issue 4 years ago • 3 comments

I load the model and try to predict the similarity between sentence A and sentence B. when I change the order of these sentences (i change the place of sentence A and B and swapped them), i get different prediction value for similarity. Why this happen?is not this measure symmetric?

ZeinabAghahadi avatar Jan 16 '20 16:01 ZeinabAghahadi

This happens because switching the sentence order will influence which pre-trained attention weights each token enters. In theory, (semantic) similarity should be symmetric - the way BERT works makes this nearly impossible.

I tried to augment the number of training instances by exploiting this symmetry. In practice, it did not lead to any real improvement in generalization.

AndriyMulyar avatar Jan 16 '20 16:01 AndriyMulyar

OK. I understood what you mean. Thank you so much

ZeinabAghahadi avatar Jan 16 '20 16:01 ZeinabAghahadi

maybe SentenceBERT can help in this case?

yuchenlin avatar Mar 24 '20 23:03 yuchenlin