code: def sentence_bleu(
      references,
      hypothesis,
      max_order=4,
      lowercase=False,
      smooth=False,
      return_all=False,
  ):
      """Calculates BLEU score of a hypothesis sentence.
  
      Args:
          references: A list of reference for the hypothesis.
              Each reference can be either a list of string tokens, or a string
              containing tokenized tokens separated with whitespaces.
              List can also be numpy array.
          hypotheses: A hypothesis sentence.
              Each hypothesis can be either a list of string tokens, or a
              string containing tokenized tokens separated with whitespaces.
              List can also be numpy array.
          lowercase (bool): If `True`, lowercase reference and hypothesis tokens.
          max_order (int): Maximum n-gram order to use when computing BLEU score.
          smooth (bool): Whether or not to apply (Lin et al. 2004) smoothing.
          return_all (bool): If `True`, returns BLEU and all n-gram precisions.
  
      Returns:
          If :attr:`return_all` is `False` (default), returns a float32
          BLEU score.
  
          If :attr:`return_all` is `True`, returns a list of float32 scores:
          `[BLEU] + n-gram precisions`, which is of length :attr:`max_order` + 1.
      """
      return corpus_bleu(
          [references],
          [hypothesis],
          max_order=max_order,
          lowercase=lowercase,
          smooth=smooth,
          return_all=return_all,
      )
  
imports: import collections
  import math
  from texar.tf.utils.dtypes import compat_as_text, is_str
label_desc: Use image node_id 4 for calling a global function with example usage: sentence_bleu(references, hypothesis, max_order, lowercase, smooth, return_all) and returns: corpus_bleu