class_docstr: Objects of this class realize the transformation between word-document co-occurrence matrix (int)
  into a locally/globally weighted TF-IDF matrix (positive floats).
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> import gensim.downloader as api
      >>> from gensim.models import TfidfModel
      >>> from gensim.corpora import Dictionary
      >>>
      >>> dataset = api.load("text8")
      >>> dct = Dictionary(dataset)  # fit dictionary
      >>> corpus = [dct.doc2bow(line) for line in dataset]  # convert corpus to BoW format
      >>>
      >>> model = TfidfModel(corpus)  # fit model
      >>> vector = model[corpus[0]]  # apply model to the first corpus document
class_docstr_tok: ["Objects","of","this","class","realize","the","transformation","between","word-document","co-occurrence","matrix","(","int",")","into","a","locally\/globally","weighted","TF-IDF","matrix","(","positive","floats",")",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","import","gensim.downloader","as","api",">",">",">","from","gensim.models","import","TfidfModel",">",">",">","from","gensim.corpora","import","Dictionary",">",">",">",">",">",">","dataset","=","api.load","(","``","text8","''",")",">",">",">","dct","=","Dictionary","(","dataset",")","#","fit","dictionary",">",">",">","corpus","=","[","dct.doc2bow","(","line",")","for","line","in","dataset","]","#","convert","corpus","to","BoW","format",">",">",">",">",">",">","model","=","TfidfModel","(","corpus",")","#","fit","model",">",">",">","vector","=","model","[","corpus","[","0","]","]","#","apply","model","to","the","first","corpus","document"]
docstr: Load a previously saved TfidfModel class. Handles backwards compatibility from
  older TfidfModel versions which did not use pivoted document normalization.
docstr_tok: ["Load","a","previously","saved","TfidfModel","class",".","Handles","backwards","compatibility","from","older","TfidfModel","versions","which","did","not","use","pivoted","document","normalization","."]
code: def load(cls, *args, **kwargs):
      """Load a previously saved TfidfModel class. Handles backwards compatibility from
      older TfidfModel versions which did not use pivoted document normalization.
  
      """
      model = super(TfidfModel, cls).load(*args, **kwargs)
      if not hasattr(model, "pivot"):
          model.pivot = None
          logger.info(
              "older version of %s loaded without pivot arg",
              cls.__name__,
          )
          logger.info("Setting pivot to %s.", model.pivot)
      if not hasattr(model, "slope"):
          model.slope = 0.65
          logger.info(
              "older version of %s loaded without slope arg",
              cls.__name__,
          )
          logger.info("Setting slope to %s.", model.slope)
      if not hasattr(model, "smartirs"):
          model.smartirs = None
          logger.info(
              "older version of %s loaded without smartirs arg",
              cls.__name__,
          )
          logger.info("Setting smartirs to %s.", model.smartirs)
      return model
  
file_path: gensim/gensim/models/tfidfmodel.py
imports: import logging
  from functools import partial
  import re
  import numpy
  from gensim import interfaces, matutils, utils
  from gensim.utils import deprecated
label_desc: Use image node_id 2 for calling the TfidfModel obj's underlying member method code with example usage: obj.load(cls) and returns: model