code: def sentence_bleu_moses(
      references, hypothesis, lowercase=False, return_all=False
  ):
      """Calculates BLEU score of a hypothesis sentence using the
      **MOSES multi-bleu.perl** script.
  
      Args:
          references: A list of reference for the hypothesis.
              Each reference can be either a string, or a list of string tokens.
              List can also be numpy array.
          hypotheses: A hypothesis sentence.
              The hypothesis can be either a string, or a list of string tokens.
              List can also be numpy array.
          lowercase (bool): If `True`, pass the "-lc" flag to the multi-bleu
              script.
          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 5 float32 scores:
          `[BLEU, 1-gram precision, ..., 4-gram precision]`.
      """
      return corpus_bleu_moses(
          [references],
          [hypothesis],
          lowercase=lowercase,
          return_all=return_all,
      )
  
file_path: texar/texar/tf/evals/bleu_moses.py
imports: import os
  from io import open
  import shutil
  import re
  import subprocess
  import tempfile
  import numpy
  import tensorflow
  from texar.tf.utils.dtypes import compat_as_text
label_desc: Use image node_id 3 for calling a global function with example usage: sentence_bleu_moses(references, hypothesis, lowercase, return_all) and returns: corpus_bleu_moses