def register_vocab(sanitized_filename: str,
                   vocabulary_size: Optional[tf.Tensor] = None,
                   vocabulary_key: Optional[str] = None,
                   file_format: common_types
                   .VocabularyFileFormatType = DEFAULT_VOCABULARY_FILE_FORMAT):
  """Registers the specificed vocabulary within the asset map.

  Args:
    sanitized_filename: The santized filename of the vocabulary.
    vocabulary_size: The size of the vocabulary.
    vocabulary_key: The key of the vocabulary to use.
    file_format: The format of the vocabulary file (text or tfrecord_gzip).
  """
  if vocabulary_key is None:
    vocabulary_key = sanitized_filename
  filename = ('{}.tfrecord.gz'.format(sanitized_filename)
              if file_format == 'tfrecord_gzip' else sanitized_filename)
  annotators.annotate_asset(vocabulary_key, filename)
  if vocabulary_size is not None:
    annotators.annotate_vocab_size(vocabulary_key, vocabulary_size)
Registers the specificed vocabulary within the asset map.

  Args:
    sanitized_filename: The santized filename of the vocabulary.
    vocabulary_size: The size of the vocabulary.
    vocabulary_key: The key of the vocabulary to use.
    file_format: The format of the vocabulary file (text or tfrecord_gzip).
  
tensorflow_transform/analyzers.py