class_docstr: Lazily compute context vectors for topic segments.
  
  Parameters
  ----------
  measure: str
      Confirmation measure.
  topics: list of numpy.array
      Topics.
  accumulator : :class:`~gensim.topic_coherence.text_analysis.WordVectorsAccumulator` or
                :class:`~gensim.topic_coherence.text_analysis.InvertedIndexAccumulator`
      Word occurrence accumulator from probability_estimation.
  gamma: float
      Value for computing vectors.
  
  Attributes
  ----------
  sim_cache: dict
      Cache similarities between tokens (pairs of word ids), e.g. (1, 2).
  context_vector_cache: dict
      Mapping from (segment, topic_words) --> context_vector.
  
  Example
  -------
  .. sourcecode:: pycon
  
      >>> from gensim.corpora.dictionary import Dictionary
      >>> from gensim.topic_coherence import indirect_confirmation_measure, text_analysis
      >>> import numpy as np
      >>>
      >>> # create measure, topics
      >>> measure = 'nlr'
      >>> topics = [np.array([1, 2])]
      >>>
      >>> # create accumulator
      >>> dictionary = Dictionary()
      >>> dictionary.id2token = {1: 'fake', 2: 'tokens'}
      >>> accumulator = text_analysis.WordVectorsAccumulator({1, 2}, dictionary)
      >>> _ = accumulator.accumulate([['fake', 'tokens'], ['tokens', 'fake']], 5)
      >>> cont_vect_comp = indirect_confirmation_measure.ContextVectorComputer(measure, topics, accumulator, 1)
      >>> cont_vect_comp.mapping
      {1: 0, 2: 1}
      >>> cont_vect_comp.vocab_size
      2
class_docstr_tok: ["Lazily","compute","context","vectors","for","topic","segments",".","Parameters","--","--","--","--","--","measure",":","str","Confirmation","measure",".","topics",":","list","of","numpy.array","Topics",".","accumulator",":",":","class",":","`","~gensim.topic_coherence.text_analysis.WordVectorsAccumulator","`","or",":","class",":","`","~gensim.topic_coherence.text_analysis.InvertedIndexAccumulator","`","Word","occurrence","accumulator","from","probability_estimation",".","gamma",":","float","Value","for","computing","vectors",".","Attributes","--","--","--","--","--","sim_cache",":","dict","Cache","similarities","between","tokens","(","pairs","of","word","ids",")",",","e.g",".","(","1",",","2",")",".","context_vector_cache",":","dict","Mapping","from","(","segment",",","topic_words",")","--",">","context_vector",".","Example","--","--","--","-","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora.dictionary","import","Dictionary",">",">",">","from","gensim.topic_coherence","import","indirect_confirmation_measure",",","text_analysis",">",">",">","import","numpy","as","np",">",">",">",">",">",">","#","create","measure",",","topics",">",">",">","measure","=","'nlr'",">",">",">","topics","=","[","np.array","(","[","1",",","2","]",")","]",">",">",">",">",">",">","#","create","accumulator",">",">",">","dictionary","=","Dictionary","(",")",">",">",">","dictionary.id2token","=","{","1",":","'fake","'",",","2",":","'tokens","'","}",">",">",">","accumulator","=","text_analysis.WordVectorsAccumulator","(","{","1",",","2","}",",","dictionary",")",">",">",">","_","=","accumulator.accumulate","(","[","[","'fake","'",",","'tokens","'","]",",","[","'tokens","'",",","'fake","'","]","]",",","5",")",">",">",">","cont_vect_comp","=","indirect_confirmation_measure.ContextVectorComputer","(","measure",",","topics",",","accumulator",",","1",")",">",">",">","cont_vect_comp.mapping","{","1",":","0",",","2",":","1","}",">",">",">","cont_vect_comp.vocab_size","2"]
code: def __getitem__(self, idx):
      return self.compute_context_vector(*idx)
  
file_path: gensim/gensim/topic_coherence/indirect_confirmation_measure.py
imports: import itertools
  import logging
  import numpy
  import scipy.sparse
  from gensim.topic_coherence.direct_confirmation_measure import aggregate_segment_sims, log_ratio_measure
label_desc: Use image node_id 2 for calling the ContextVectorComputer obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self