def entropy(self, text):
    """
    https://github.com/nltk/nltk/blob/model/nltk/model/ngram.py
    Calculate the approximate cross-entropy of the n-gram model for a
    given evaluation text.
    This is the average log probability of each word in the text.
    :param text: words to use for evaluation
    :type text: Iterable[str]
    """

    normed_text = (self._check_against_vocab(word) for word in text)
    H = 0.0     # entropy is conventionally denoted by "H"
    processed_ngrams = 0
    for ngram in self.ngram_counter.to_ngrams(normed_text):
        context, word = tuple(ngram[:-1]), ngram[-1]
        H += self.logscore(word, context)
        processed_ngrams += 1
    return - (H / processed_ngrams)