code: def bleu_wrapper(ref_filename, hyp_filename, case_sensitive=False):
      """Compute BLEU for two files (reference and hypothesis translation)."""
      ref_lines = (
          open(ref_filename, encoding="utf-8").read().splitlines()
      )
      hyp_lines = (
          open(hyp_filename, encoding="utf-8").read().splitlines()
      )
      assert 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 compute_bleu(ref_tokens, hyp_tokens)
  
file_path: texar/examples/transformer/bleu_tool.py
imports: from argparse import ArgumentParser
  from io import open
  import collections
  import math
  import re
  import sys
  import unicodedata
  import numpy
  import six
  from six.moves import xrange
  from six.moves import zip
label_desc: Use image node_id 4 for calling a global function with example usage: bleu_wrapper(ref_filename, hyp_filename, case_sensitive) and returns: compute_bleu