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

Getting IndexError when any of 'cands', 'refs' and 'sources' contains empty string #4

Open
terryyz opened this issue Apr 23, 2023 · 6 comments

Comments

@terryyz
Copy link

terryyz commented Apr 23, 2023

Current code_bert_score is able to handle the case where any of 'cands', 'refs' contains empty strings and no 'sources' is passed to the score method. See the example below:

from code_bert_score import score
score([''],['a'], lang="python")

However, when 'sources' is provided, the method will raise IndexError.

from code_bert_score import score
score([''],['a'], sources=["a"], lang="python")

It would be great if this kind of cases can be handled.

@urialon
Copy link
Collaborator

urialon commented Apr 25, 2023

Thanks @terryyz !
I just pushed a fix.

In case the cand or ref is an empty string, I am now setting both precision and recall to zero.
It is now working when sources are provided or not provided.

Please let us know if you have any questions or find any other issues!
Best,
Uri

@littlepopy
Copy link

Can I ask you the data provided under code-bert-score/evaluation come from where? The generation codes ### (humaneval_hyps.txt) of 13025 lines, with the corresponding NL**(humaneval_srcs.txt)** and reference code**(humaneval_refs.txt)** . And if we want to use the data, is it be promised?

@terryyz
Copy link
Author

terryyz commented Jan 4, 2024

Hi @littlepopy, the details were discussed in Appendix B.2 in the paper, where the data was collected from HumanEval-X. Besides, you may also find our paper useful. This folder may provide all the data you need 😃

@urialon
Copy link
Collaborator

urialon commented Jan 4, 2024

Hi @littlepopy ,
Thank you for your interest in our work.

Please see the paragraph "functional correctness experiments" in Section 3.2 in the paper https://arxiv.org/pdf/2302.05527.pdf

And also, Appendix B.2.

Let us know if you have any questions!
Uri

@littlepopy
Copy link

littlepopy commented Jan 4, 2024 via email

@littlepopy
Copy link

littlepopy commented Jan 4, 2024 via email

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