def token_ids_to_str(self, token_ids):
    """Converts a list of token IDs back to a human-readable string.

    WARNING: this is ONLY for debug purposes. It does NOT perfectly invert BERT
    tokenization to recover the original text.

    Args:
      token_ids: a list of ints.

    Returns:
      a str
    """
    token_strs = self._base_tokenizer.convert_ids_to_tokens(token_ids)

    formatted_strs = []
    for i, token_str in enumerate(token_strs):
      if token_str.startswith('##'):
        # No whitespace in front, and strip the double hash.
        formatted_strs.append(token_str[2:])
      else:
        if i != 0:
          # Whitespace before the token, unless you're the first token.
          formatted_strs.append(' ')
        formatted_strs.append(token_str)

    return ''.join(formatted_strs)
Converts a list of token IDs back to a human-readable string.

    WARNING: this is ONLY for debug purposes. It does NOT perfectly invert BERT
    tokenization to recover the original text.

    Args:
      token_ids: a list of ints.

    Returns:
      a str
    
language/realm/featurization.py