def text_hash_tf(text: tf.Tensor, seq_length: int) -> tf.Tensor:
  """Given 1D integer array with token IDs produces integer hash."""
  return tf.squeeze(
      tf.math.polyval(
          tf.split(text, num_or_size_splits=seq_length),
          tf.constant(100003, dtype=text.dtype)), 0)
Given 1D integer array with token IDs produces integer hash.
language/mentionmemory/utils/mention_preprocess_utils.py