def rouge_2_fscore(logits, labels):
    'ROUGE-2 F1 score computation between labels and predictions.\n\n  This is an approximate ROUGE scoring method since we do not glue word pieces\n  or decode the ids and tokenize the output.\n\n  Args:\n    logits: tensor, model predictions\n    labels: tensor, gold output.\n\n  Returns:\n    rouge2_fscore: approx rouge-2 f1 score.\n  '
    predictions = tf.to_int32(tf.argmax(logits, axis=(- 1)))
    rouge_2_f_score = tf.py_func(rouge_n, (predictions, labels), tf.float32)
    return (rouge_2_f_score, tf.constant(1.0))
ROUGE-2 F1 score 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:
  logits: tensor, model predictions
  labels: tensor, gold output.

Returns:
  rouge2_fscore: approx rouge-2 f1 score.
def rouge_2_fscore(logits, labels):
    'ROUGE-2 F1 score computation between labels and predictions.\n\n  This is an approximate ROUGE scoring method since we do not glue word pieces\n  or decode the ids and tokenize the output.\n\n  Args:\n    logits: tensor, model predictions\n    labels: tensor, gold output.\n\n  Returns:\n    rouge2_fscore: approx rouge-2 f1 score.\n  '
    predictions = tf.to_int32(tf.argmax(logits, axis=(- 1)))
    rouge_2_f_score = tf.py_func(rouge_n, (predictions, labels), tf.float32)
    return (rouge_2_f_score, tf.constant(1.0))