code: def get_sufficient_stats(
      translations: List[str], references: List[str]
  ) -> pd.DataFrame:
      assert len(translations) == len(references), (
          f"There are {len(translations)} translated sentences "
          f"but {len(references)} reference sentences"
      )
      assert sacrebleu.metrics.bleu.BLEU.NGRAM_ORDER == 4, (
          f"Expected SacreBLEU to be using n-gram order 4 "
          f"instead of {sacrebleu.metrics.bleu.BLEU.NGRAM_ORDER}."
      )
  
      sufficient_stats: List[List[int]] = []
      for sentence, ref in zip(translations, references):
          sentence_bleu = sacrebleu.corpus_bleu(
              sys_stream=sentence,
              ref_streams=ref,
              lowercase=False,
              tokenize="none",
              use_effective_order=False,
          )
          sufficient_stats.append(
              [
                  # Number of correct 1-grams, .., 4-grams
                  sentence_bleu.counts[0],
                  sentence_bleu.counts[1],
                  sentence_bleu.counts[2],
                  sentence_bleu.counts[3],
                  # Total number of 1-grams, .., 4-grams
                  sentence_bleu.totals[0],
                  sentence_bleu.totals[1],
                  sentence_bleu.totals[2],
                  sentence_bleu.totals[3],
                  # Length of translated sentence.
                  sentence_bleu.sys_len,
                  # Length of reference sentence.
                  sentence_bleu.ref_len,
              ]
          )
      return pd.DataFrame(
          sufficient_stats,
          columns=[
              "correct_1_grams",
              "correct_2_grams",
              "correct_3_grams",
              "correct_4_grams",
              "total_1_grams",
              "total_2_grams",
              "total_3_grams",
              "total_4_grams",
              "translation_length",
              "reference_length",
          ],
      )
  
file_path: translate/pytorch_translate/bleu_significance.py
imports: import argparse
  from typing import List, NamedTuple, Optional
  import numpy
  import pandas
  import sacrebleu
label_desc: Use image node_id 1 for calling a global function with example usage: get_sufficient_stats(translations, references) and returns: pd