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

Fixes #2571 #2572

Merged
merged 1 commit into from Dec 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions nltk/translate/bleu_score.py
Expand Up @@ -541,8 +541,9 @@ def method2(self, p_n, *args, **kwargs):
skip-bigram statistics. In ACL04.
"""
return [
Fraction(p_i.numerator + 1, p_i.denominator + 1, _normalize=False)
for p_i in p_n
Fraction(p_n[i].numerator + 1, p_n[i].denominator + 1, _normalize=False)
if i != 0 else p_n[0]
for i in range(len(p_n))
]

def method3(self, p_n, *args, **kwargs):
Expand Down