"git@developer.sourcefind.cn:OpenDAS/pyg_autoscale.git" did not exist on "5a8b5eac9df6e3fa419bebfed2a60b498df2462c"
Commit cdfc1ddd authored by Sergey Mironov's avatar Sergey Mironov
Browse files

Output exact numbers of unmatching lines in BLEU

parent 4ae295c3
...@@ -93,8 +93,8 @@ def bleu_wrapper(ref_filename, hyp_filename, case_sensitive=False): ...@@ -93,8 +93,8 @@ def bleu_wrapper(ref_filename, hyp_filename, case_sensitive=False):
if len(ref_lines) != len(hyp_lines): if len(ref_lines) != len(hyp_lines):
raise ValueError("Reference and translation files have different number of " raise ValueError("Reference and translation files have different number of "
"lines. If training only a few steps (100-200), the " "lines (%d VS %d). If training only a few steps (100-200), the "
"translation may be empty.") "translation may be empty." % (len(ref_lines), len(hyp_lines)))
if not case_sensitive: if not case_sensitive:
ref_lines = [x.lower() for x in ref_lines] ref_lines = [x.lower() for x in ref_lines]
hyp_lines = [x.lower() for x in hyp_lines] hyp_lines = [x.lower() for x in hyp_lines]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment