class_docstr: Objects of this class realize the transformation between word-document co-occurrence matrix (int)
  into a locally/globally weighted matrix (positive floats).
  
  This is done by a log entropy normalization, optionally normalizing the resulting documents to unit length.
  The following formulas explain how o compute the log entropy weight for term :math:`i` in document :math:`j`:
  
  .. math::
  
      local\_weight_{i,j} = log(frequency_{i,j} + 1)
  
      P_{i,j} = \frac{frequency_{i,j}}{\sum_j frequency_{i,j}}
  
      global\_weight_i = 1 + \frac{\sum_j P_{i,j} * log(P_{i,j})}{log(number\_of\_documents + 1)}
  
      final\_weight_{i,j} = local\_weight_{i,j} * global\_weight_i
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.models import LogEntropyModel
      >>> from gensim.test.utils import common_texts
      >>> from gensim.corpora import Dictionary
      >>>
      >>> dct = Dictionary(common_texts)  # fit dictionary
      >>> corpus = [dct.doc2bow(row) for row in common_texts]  # convert to BoW format
      >>> model = LogEntropyModel(corpus)  # fit model
      >>> vector = model[corpus[1]]  # apply model to document
docstr: Get log entropy representation of the input vector and/or corpus.
  
  Parameters
  ----------
  bow : list of (int, int)
      Document in BoW format.
  
  Returns
  -------
  list of (int, float)
      Log-entropy vector for passed `bow`.
code: def __getitem__(self, bow):
      """Get log entropy representation of the input vector and/or corpus.
  
      Parameters
      ----------
      bow : list of (int, int)
          Document in BoW format.
  
      Returns
      -------
      list of (int, float)
          Log-entropy vector for passed `bow`.
  
      """
      # if the input vector is in fact a corpus, return a transformed corpus
      is_corpus, bow = utils.is_corpus(bow)
      if is_corpus:
          return self._apply(bow)
  
      # unknown (new) terms will be given zero weight (NOT infinity/huge)
      vector = [
          (term_id, math.log(tf + 1) * self.entr.get(term_id))
          for term_id, tf in bow
          if term_id in self.entr
      ]
      if self.normalize:
          vector = matutils.unitvec(vector)
      return vector
  
file_path: gensim/gensim/models/logentropy_model.py
imports: import logging
  import math
  from gensim import interfaces, matutils, utils
label_desc: Use image node_id 4 for calling the LogEntropyModel obj's underlying member method code with example usage: obj.__getitem__(bow) and returns: vector, self