code: def calc_bleu_from_stats(
      sentence_stats: pd.DataFrame,
  ) -> sacrebleu.BLEU:
      corpus_stats = sentence_stats.sum(axis=0)
      corpus_bleu = sacrebleu.compute_bleu(
          correct=[
              corpus_stats.correct_1_grams,
              corpus_stats.correct_2_grams,
              corpus_stats.correct_3_grams,
              corpus_stats.correct_4_grams,
          ],
          total=[
              corpus_stats.total_1_grams,
              corpus_stats.total_2_grams,
              corpus_stats.total_3_grams,
              corpus_stats.total_4_grams,
          ],
          sys_len=corpus_stats.translation_length,
          ref_len=corpus_stats.reference_length,
      )
      return corpus_bleu
  
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 2 for calling a global function with example usage: calc_bleu_from_stats(sentence_stats) and returns: corpus_bleu