def METHOD_NAME(self):
    """
    Calculates and returns the value of perplexity.
    Returns:
        float: Returns `perplexity`, the calculation results.
    """
    return np.exp(self.total_ce / self.total_word_num)