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: Parameters
  ----------
  corpus : iterable of iterable of (int, int)
      Input corpus in BoW format.
  normalize : bool, optional
      If True, the resulted log entropy weighted vector will be normalized to length of 1,
      If False - do nothing.
code: def __init__(self, corpus, normalize=True):
      """
  
      Parameters
      ----------
      corpus : iterable of iterable of (int, int)
          Input corpus in BoW format.
      normalize : bool, optional
          If True, the resulted log entropy weighted vector will be normalized to length of 1,
          If False - do nothing.
  
      """
      self.normalize = normalize
      self.n_docs = 0
      self.n_words = 0
      self.entr = {}
      if corpus is not None:
          self.initialize(corpus)
  
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 1 to create a new LogEntropyModel object from inherited base classes: interfaces with example: obj = LogEntropyModel(corpus, normalize)