Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem when swapped sentences #8

Open
ZeinabAghahadi opened this issue Jan 16, 2020 · 3 comments
Open

problem when swapped sentences #8

ZeinabAghahadi opened this issue Jan 16, 2020 · 3 comments

Comments

@ZeinabAghahadi
Copy link

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?

@AndriyMulyar
Copy link
Owner

AndriyMulyar commented Jan 16, 2020

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.

@ZeinabAghahadi
Copy link
Author

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

@yuchenlin
Copy link

maybe SentenceBERT can help in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants