Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
cdfc1ddd
"git@developer.sourcefind.cn:OpenDAS/pyg_autoscale.git" did not exist on "5a8b5eac9df6e3fa419bebfed2a60b498df2462c"
Commit
cdfc1ddd
authored
Mar 19, 2020
by
Sergey Mironov
Browse files
Output exact numbers of unmatching lines in BLEU
parent
4ae295c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/transformer/compute_bleu.py
official/nlp/transformer/compute_bleu.py
+2
-2
No files found.
official/nlp/transformer/compute_bleu.py
View file @
cdfc1ddd
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment