code: def main(_):
      rouge = pyrouge.Rouge155()
      rouge.log.setLevel(logging.ERROR)
      rouge.system_filename_pattern = "rouge.(\\d+).txt"
      rouge.model_filename_pattern = "rouge.[A-Z].#ID#.txt"
  
      tf.logging.set_verbosity(tf.logging.INFO)
  
      tmpdir = mkdtemp()
      tf.logging.info("tmpdir: %s" % tmpdir)
      # system = decodes/predictions
      system_dir = os.path.join(tmpdir, "system")
      # model = targets/gold
      model_dir = os.path.join(tmpdir, "model")
      os.mkdir(system_dir)
      os.mkdir(model_dir)
  
      rouge.system_dir = system_dir
      rouge.model_dir = model_dir
  
      prep_data(rouge.system_dir, rouge.model_dir)
  
      rouge_scores = rouge.convert_and_evaluate()
      rouge_scores = rouge.output_to_dict(rouge_scores)
      for prefix in ["rouge_1", "rouge_2", "rouge_l"]:
          for suffix in ["f_score", "precision", "recall"]:
              key = "_".join([prefix, suffix])
              tf.logging.info("%s: %.4f" % (key, rouge_scores[key]))
  
      # clean up after pyrouge
      shutil.rmtree(tmpdir)
      shutil.rmtree(
          rouge._config_dir
      )  # pylint: disable=protected-access
      shutil.rmtree(os.path.split(rouge._system_dir)[0])
  
file_path: tensor2tensor/tensor2tensor/utils/get_rouge.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import os
  import shutil
  from tempfile import mkdtemp
  import pyrouge
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: main(_) without return types