code: def testTermFrequency(self):
      input_tensor = tf.SparseTensor(
          [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 0], [1, 1]],
          [1, 2, 0, 0, 0, 3, 0],
          [2, 5],
      )
      self.assertSparseOutput(
          expected_indices=[[0, 0], [0, 1], [0, 2], [1, 0], [1, 3]],
          expected_values=[(3 / 5), (1 / 5), (1 / 5), (1 / 2), (1 / 2)],
          expected_shape=[2, 4],
          actual_sparse_tensor=mappers._to_term_frequency(
              input_tensor, 4
          ),
          close_values=True,
      )
  
imports: import numpy
  import tensorflow
  from tensorflow_transform import mappers
  from tensorflow_transform import test_case
label_desc: Use image node_id 18 for calling the MappersTest obj's underlying member method code with example usage: obj.testTermFrequency() without return types