docstr: Toy example where Input='1 2', Output='1 2', References=['1'].
docstr_tok: ["Toy","example","where","Input=","'","1","2","'",",","Output=","'","1","2","'",",","References=","[","'","1","'","]","."]
code: def testDeletionScore(self):
      """Toy example where Input='1 2', Output='1 2', References=['1']."""
      # Unigram counts.
      source_counts = collections.Counter({1: 1, 2: 1})
      prediction_counts = collections.Counter({1: 1, 2: 1})
      target_counts = collections.Counter({1: 1})
      # Output doesn't drop any (incorrect) tokens from the input so precision
      # should be 1, but since '2' is not dropped, recall should be 0. Thus we
      # should have F1=0 and F0=precision=1.
      f1_score = sari_hook.get_deletion_score(
          source_counts, prediction_counts, target_counts, beta=1
      )
      self.assertEqual(0, f1_score)
      f0_score = sari_hook.get_deletion_score(
          source_counts, prediction_counts, target_counts, beta=0
      )
      self.assertEqual(1, f0_score)
  
file_path: tensor2tensor/tensor2tensor/utils/sari_hook_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling the SariHookTest obj's underlying member method code with example usage: obj.testDeletionScore() without return types