def _get_length(self, x):
    """Gets the number of tokens in a string."""
    tokens = self.tokenizer.tokenize(x)
    length = tokens.shape[0]
    return length
Gets the number of tokens in a string.
language/fruit/rendering_utils.py