code: def get_addition_score(
      source_counts, prediction_counts, target_counts
  ):
      """Compute the addition score (Equation 4 in the paper)."""
      added_to_prediction_counts = prediction_counts - source_counts
      true_positives = sum(
          (added_to_prediction_counts & target_counts).values()
      )
      selected = sum(added_to_prediction_counts.values())
      # Note that in the paper the summation is done over all the ngrams in the
      # output rather than the ngrams in the following set difference. Since the
      # former does not make as much sense we compute the latter, which is also done
      # in the GitHub implementation.
      relevant = sum((target_counts - source_counts).values())
      return _get_fbeta_score(true_positives, selected, relevant)
  
file_path: tensor2tensor/tensor2tensor/utils/sari_hook.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: get_addition_score(source_counts, prediction_counts, target_counts) and returns: _get_fbeta_score