You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
def_union_lcs(evaluated_sentences, reference_sentence):
iflen(evaluated_sentences) <=0:
raise (ValueError("Collections must contain at least 1 sentence."))
lcs_union=set()
reference_words=_split_into_words(reference_sentence)
combined_lcs_length=0foreval_sinevaluated_sentences:
evaluated_words=_split_into_words(eval_s)
lcs=set(_recon_lcs(reference_words, evaluated_words))
combined_lcs_length+=len(lcs)
lcs_union=lcs_union.union(lcs)
union_lcs_count=len(lcs_union)
# Here the modification:ifcombined_lcs_length==0:
return0union_lcs_value=union_lcs_count/combined_lcs_lengthreturnunion_lcs_value
The text was updated successfully, but these errors were encountered:
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 ?
The text was updated successfully, but these errors were encountered: