class_docstr: ABC for Language Models.
  
  Cannot be directly instantiated itself.
docstr: Calculate cross-entropy of model for given evaluation text.
  
  :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
  :rtype: float
docstr_tok: ["Calculate","cross-entropy","of","model","for","given","evaluation","text",".",":","param","Iterable","(","tuple","(","str",")",")","text_ngrams",":","A","sequence","of","ngram","tuples",".",":","rtype",":","float"]
code: def entropy(self, text_ngrams):
      """Calculate cross-entropy of model for given evaluation text.
  
      :param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
      :rtype: float
  
      """
      return -1 * _mean(
          [
              self.logscore(ngram[-1], ngram[:-1])
              for ngram in text_ngrams
          ]
      )
  
imports: import random
  import warnings
  from abc import ABCMeta, abstractmethod
  from bisect import bisect
  from itertools import accumulate
  from nltk.lm.counter import NgramCounter
  from nltk.lm.util import log_base2
  from nltk.lm.vocabulary import Vocabulary
label_desc: Use image node_id 7 for calling the LanguageModel obj's underlying member method code with example usage: obj.entropy(text_ngrams) and returns: unknown