ecf13b0e5f0d47d60b0eedb15e7944327969a1fb,official/nlp/transformer/compute_bleu.py,,bleu_wrapper,#Any#Any#Any#,89
Before Change
"lines (%d VS %d). If training only a few steps (100-200), the "
"translation may be empty." % (len(ref_lines), len(hyp_lines)))
if not case_sensitive:
ref_lines = [x.lower() for x in ref_lines]
hyp_lines = [x.lower() for x in hyp_lines]
ref_tokens = [bleu_tokenize(x) for x in ref_lines]
hyp_tokens = [bleu_tokenize(x) for x in hyp_lines]
return metrics.compute_bleu(ref_tokens, hyp_tokens) * 100
def main(unused_argv):
if FLAGS.bleu_variant in ("both", "uncased"):
After Change
tf.io.gfile.GFile(ref_filename).read()).strip().splitlines()
hyp_lines = tokenizer.native_to_unicode(
tf.io.gfile.GFile(hyp_filename).read()).strip().splitlines()
return bleu_on_list(ref_lines, hyp_lines, case_sensitive)
def bleu_on_list(ref_lines, hyp_lines, case_sensitive=False):
Compute BLEU for two list of strings (reference and hypothesis).
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances Project Name: tensorflow/models
Commit Name: ecf13b0e5f0d47d60b0eedb15e7944327969a1fb
Time: 2020-06-23
Author: gardener@tensorflow.org
File Name: official/nlp/transformer/compute_bleu.py
Class Name:
Method Name: bleu_wrapper
Project Name: pytorch/text
Commit Name: 638810ae894784dec9d65abe156ea2fba11f289e
Time: 2020-08-07
Author: 22487263+Nayef211@users.noreply.github.com
File Name: torchtext/experimental/transforms.py
Class Name: BasicEnglishNormalize
Method Name: forward
Project Name: tensorflow/models
Commit Name: 69e5a2d56cefd3774a5d4a4a6f77b0af3357a206
Time: 2020-06-23
Author: gardener@tensorflow.org
File Name: official/nlp/transformer/compute_bleu.py
Class Name:
Method Name: bleu_wrapper
Project Name: ilastik/ilastik
Commit Name: 00bddb634308c00dc8e03ee1859c621039cc8808
Time: 2019-07-08
Author: tomaz.vieira@embl.de
File Name: ilastik/applets/dataSelection/dataSelectionApplet.py
Class Name: DataSelectionApplet
Method Name: _role_name_to_arg_name