Open dorianve opened 5 years ago
The same goes for def _f_lcs(...)
where denom
could be 0. So I also added :
# ...
if denom == 0:
return 0
# ...
Hi @dorianve, can you attach some simple test to reproduce this? Or maybe create a PR with the test and a fix? You can't update the repository, but you are welcome to send me a PR :)
Hello,
I have had some ZeroDivisionErrors trying to get the Rouge-L summary level score for one of my data.
The problem was in the function _union_lcs of rouge.py where the "union longest common subsequence count" was divided by the "combined LCS length".
I added the case when combined_lcs_length was equal to 0 to return 0, and it's working fine now. (I mean, I added that case locally, I cannot change it in this repository)
Does it sound right ?