code: def rouge_l_fscore(predictions, labels, **unused_kwargs):
      """ROUGE scores computation between labels and predictions.
  
      This is an approximate ROUGE scoring method since we do not glue word pieces
      or decode the ids and tokenize the output.
  
      Args:
        predictions: tensor, model predictions
        labels: tensor, gold output.
  
      Returns:
        rouge_l_fscore: approx rouge-l f1 score.
      """
      outputs = tf.to_int32(tf.argmax(predictions, axis=-1))
      # Convert the outputs and labels to a [batch_size, input_length] tensor.
      outputs = tf.squeeze(outputs, axis=[-1, -2])
      labels = tf.squeeze(labels, axis=[-1, -2])
      rouge_l_f_score = tf.py_func(
          rouge_l_sentence_level, (outputs, labels), tf.float32
      )
      return rouge_l_f_score, tf.constant(1.0)
  
file_path: tensor2tensor/tensor2tensor/utils/rouge.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling a global function with example usage: rouge_l_fscore(predictions, labels) and returns: rouge_l_f_score,  tf