gensim.models.NormModel.__init__¶
-
NormModel.
__init__
(corpus=None, norm='l2')[source]¶ Compute the ‘l1’ or ‘l2’ normalization by normalizing separately for each doc in a corpus. Formula for ‘l1’ norm for term ‘i’ in document ‘j’ in a corpus of ‘D’ documents is:
norml1_{i, j} = (i / sum(absolute(values in j)))
Formula for ‘l2’ norm for term ‘i’ in document ‘j’ in a corpus of ‘D’ documents is:
norml2_{i, j} = (i / sqrt(sum(square(values in j))))