docstr: Referenced from NMT evaluation
  Note 13a is the default tokenizer for English for WMT
  Known issue that it doesn't hand edge case of None or '' 
  https://github.com/mjpost/sacrebleu/issues/161
docstr_tok: ["Referenced","from","NMT","evaluation","Note","13a","is","the","default","tokenizer","for","English","for","WMT","Known","issue","that","it","does","n't","hand","edge","case","of","None","or","``","https",":","\/\/github.com\/mjpost\/sacrebleu\/issues\/161"]
code: def get_bleu(generated_field, ground_truth_field):
      """
      Referenced from NMT evaluation
      Note 13a is the default tokenizer for English for WMT
      Known issue that it doesn't hand edge case of None or ''
      https://github.com/mjpost/sacrebleu/issues/161
      """
      valid_indices = [
          i
          for i in range(len(generated_field))
          if generated_field[i] and ground_truth_field[i]
      ]
      generated_field = [generated_field[i] for i in valid_indices]
      ground_truth_field = [
          ground_truth_field[i] for i in valid_indices
      ]
      sacre_bleu = corpus_bleu(
          generated_field, [ground_truth_field], tokenize="13a"
      )
      return sacre_bleu.score
  
file_path: NeMo/nemo/collections/nlp/metrics/dialogue_metrics.py
imports: import json
  from collections import Counter
  import numpy
  from sacrebleu import corpus_bleu
label_desc: Use image node_id 4 for calling the DialogueGenerationMetrics obj's underlying member method code with example usage: obj.get_bleu(generated_field, ground_truth_field) and returns: sacre_bleu