class_docstr: Metric class for perplexity evaluation.
class_docstr_tok: ["Metric","class","for","perplexity","evaluation","."]
docstr: Get the coherence score.
  
  Parameters
  ----------
  **kwargs
      Key word arguments to override the object's internal attributes.
      A trained topic model is expected using the 'model' key.
      This must be of type :class:`~gensim.models.ldamodel.LdaModel`.
  
  Returns
  -------
  float
      The perplexity score.
docstr_tok: ["Get","the","coherence","score",".","Parameters","--","--","--","--","--","*","*","kwargs","Key","word","arguments","to","override","the","object","'s","internal","attributes",".","A","trained","topic","model","is","expected","using","the","'model","'","key",".","This","must","be","of","type",":","class",":","`","~gensim.models.ldamodel.LdaModel","`",".","Returns","--","--","--","-","float","The","perplexity","score","."]
code: def get_value(self, **kwargs):
      """Get the coherence score.
  
      Parameters
      ----------
      **kwargs
          Key word arguments to override the object's internal attributes.
          A trained topic model is expected using the 'model' key.
          This must be of type :class:`~gensim.models.ldamodel.LdaModel`.
  
      Returns
      -------
      float
          The perplexity score.
  
      """
      super(PerplexityMetric, self).set_parameters(**kwargs)
      corpus_words = sum(
          cnt for document in self.corpus for _, cnt in document
      )
      perwordbound = self.model.bound(self.corpus) / corpus_words
      return np.exp2(-perwordbound)
  
imports: import gensim
  import logging
  import copy
  import sys
  import numpy
label_desc: Use image node_id 2 for calling the PerplexityMetric obj's underlying member method code with example usage: obj.get_value() and returns: np