class_docstr: Objects of this class allow for building and maintaining a model for topic coherence.
  
  Examples
  ---------
  One way of using this feature is through providing a trained topic model. A dictionary has to be explicitly provided
  if the model does not contain a dictionary already
  
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_corpus, common_dictionary
      >>> from gensim.models.ldamodel import LdaModel
      >>> from gensim.models.coherencemodel import CoherenceModel
      >>>
      >>> model = LdaModel(common_corpus, 5, common_dictionary)
      >>>
      >>> cm = CoherenceModel(model=model, corpus=common_corpus, coherence='u_mass')
      >>> coherence = cm.get_coherence()  # get coherence value
  
  Another way of using this feature is through providing tokenized topics such as:
  
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_corpus, common_dictionary
      >>> from gensim.models.coherencemodel import CoherenceModel
      >>> topics = [
      ...     ['human', 'computer', 'system', 'interface'],
      ...     ['graph', 'minors', 'trees', 'eps']
      ... ]
      >>>
      >>> cm = CoherenceModel(topics=topics, corpus=common_corpus, dictionary=common_dictionary, coherence='u_mass')
      >>> coherence = cm.get_coherence()  # get coherence value
class_docstr_tok: ["Objects","of","this","class","allow","for","building","and","maintaining","a","model","for","topic","coherence",".","Examples","--","--","--","--","-","One","way","of","using","this","feature","is","through","providing","a","trained","topic","model",".","A","dictionary","has","to","be","explicitly","provided","if","the","model","does","not","contain","a","dictionary","already","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_corpus",",","common_dictionary",">",">",">","from","gensim.models.ldamodel","import","LdaModel",">",">",">","from","gensim.models.coherencemodel","import","CoherenceModel",">",">",">",">",">",">","model","=","LdaModel","(","common_corpus",",","5",",","common_dictionary",")",">",">",">",">",">",">","cm","=","CoherenceModel","(","model=model",",","corpus=common_corpus",",","coherence='u_mass","'",")",">",">",">","coherence","=","cm.get_coherence","(",")","#","get","coherence","value","Another","way","of","using","this","feature","is","through","providing","tokenized","topics","such","as",":","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_corpus",",","common_dictionary",">",">",">","from","gensim.models.coherencemodel","import","CoherenceModel",">",">",">","topics","=","[","...","[","'human","'",",","'computer","'",",","'system","'",",","'interface","'","]",",","...","[","'graph","'",",","'minors","'",",","'trees","'",",","'eps","'","]","...","]",">",">",">",">",">",">","cm","=","CoherenceModel","(","topics=topics",",","corpus=common_corpus",",","dictionary=common_dictionary",",","coherence='u_mass","'",")",">",">",">","coherence","=","cm.get_coherence","(",")","#","get","coherence","value"]
docstr: Get list of coherence values for each topic based on pipeline parameters.
  
  Parameters
  ----------
  segmented_topics : list of list of (int, number)
      Topics.
  with_std : bool, optional
      True to also include standard deviation across topic segment sets in addition to the mean coherence
      for each topic.
  with_support : bool, optional
      True to also include support across topic segments. The support is defined as the number of pairwise
      similarity comparisons were used to compute the overall topic coherence.
  
  Return
  ------
  list of float
      Sequence of similarity measure for each topic.
docstr_tok: ["Get","list","of","coherence","values","for","each","topic","based","on","pipeline","parameters",".","Parameters","--","--","--","--","--","segmented_topics",":","list","of","list","of","(","int",",","number",")","Topics",".","with_std",":","bool",",","optional","True","to","also","include","standard","deviation","across","topic","segment","sets","in","addition","to","the","mean","coherence","for","each","topic",".","with_support",":","bool",",","optional","True","to","also","include","support","across","topic","segments",".","The","support","is","defined","as","the","number","of","pairwise","similarity","comparisons","were","used","to","compute","the","overall","topic","coherence",".","Return","--","--","--","list","of","float","Sequence","of","similarity","measure","for","each","topic","."]
code: def get_coherence_per_topic(
      self, segmented_topics=None, with_std=False, with_support=False
  ):
      """Get list of coherence values for each topic based on pipeline parameters.
  
      Parameters
      ----------
      segmented_topics : list of list of (int, number)
          Topics.
      with_std : bool, optional
          True to also include standard deviation across topic segment sets in addition to the mean coherence
          for each topic.
      with_support : bool, optional
          True to also include support across topic segments. The support is defined as the number of pairwise
          similarity comparisons were used to compute the overall topic coherence.
  
      Return
      ------
      list of float
          Sequence of similarity measure for each topic.
  
      """
      measure = self.measure
      if segmented_topics is None:
          segmented_topics = measure.seg(self.topics)
      if self._accumulator is None:
          self.estimate_probabilities(segmented_topics)
  
      kwargs = dict(with_std=with_std, with_support=with_support)
      if (
          self.coherence in BOOLEAN_DOCUMENT_BASED
          or self.coherence == "c_w2v"
      ):
          pass
      elif self.coherence == "c_v":
          kwargs["topics"] = self.topics
          kwargs["measure"] = "nlr"
          kwargs["gamma"] = 1
      else:
          kwargs["normalize"] = self.coherence == "c_npmi"
  
      return measure.conf(segmented_topics, self._accumulator, **kwargs)
  
imports: import logging
  import multiprocessing
  from collections import namedtuple
  import numpy
  from gensim import interfaces, matutils
  from gensim import utils
  from gensim.topic_coherence import segmentation, probability_estimation, direct_confirmation_measure, indirect_confirmation_measure, aggregation
  from gensim.topic_coherence.probability_estimation import unique_ids_from_segments
label_desc: Use image node_id 21 for calling the CoherenceModel obj's underlying member method code with example usage: obj.get_coherence_per_topic(segmented_topics, with_std, with_support) and returns: measure