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

Empty candidate sentence #107

Closed
achingacham opened this issue Jul 27, 2021 · 1 comment
Closed

Empty candidate sentence #107

achingacham opened this issue Jul 27, 2021 · 1 comment

Comments

@achingacham
Copy link

achingacham commented Jul 27, 2021

Hi,

Could someone help me understand why is the BERTScore recall is non zero when there is an empty candidate sentence. Isn't zero the right score for precision as well as recall over here?

score([''], ['hello how are you'], lang='en')

This is what the model returns now:

Warning: Empty candidate sentence detected; setting precision to be 0.
(tensor([0.]), tensor([0.7738]), tensor([0.]))

best,
Anupama

Originally posted by @achingacham in #62 (comment)

@felixgwu
Copy link
Collaborator

felixgwu commented Aug 1, 2021

Hi @achingacham,

Good catch! Thanks a lot! It comes from the fact that the recall uses the [CLS] and [EOS] tokens added to the empty sentences, so the scores are not zero. However, I believe it is more reasonable to set it as zero. I have fixed this bug in a new commit b1a346.

Best,
Felix

@felixgwu felixgwu closed this as completed Aug 1, 2021
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

2 participants