class_docstr: Computes BLEU Score.
class_docstr_tok: ["Computes","BLEU","Score","."]
code: def add_input(
      self,
      accumulator: np.ndarray,
      element: metric_types.StandardMetricInputs,
  ) -> np.ndarray:
      # references = labels, hypotheses = predictions
      references, hypotheses, _ = next(
          metric_util.to_label_prediction_example_weight(
              element,
              eval_config=self.eval_config,
              model_name=self.model_name,
              output_name=self.output_name,
              example_weighted=False,  # Example weights not honored
              flatten=False,
              squeeze=False,
          )
      )
  
      # TODO(b/299345719): Remove call to protected member
      new_stats = self.bleu_metric._extract_corpus_statistics(  # pylint:disable=protected-access
          hypotheses.tolist(), references.tolist()
      )
  
      # Sum accumulator and new stats
      return accumulator + np.sum(new_stats, axis=0)
  
file_path: model-analysis/tensorflow_model_analysis/metrics/bleu.py
imports: from typing import Dict, Iterable, Optional
  import apache_beam
  import numpy
  import sacrebleu
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 3 for calling the _BleuCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: unknown