class_docstr: The scoring function of Apache Lucene 8 [4]_.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import Dictionary
      >>> from gensim.models import LuceneBM25Model
      >>> from gensim.test.utils import common_texts
      >>>
      >>> dictionary = Dictionary(common_texts)  # fit dictionary
      >>> corpus = [dictionary.doc2bow(line) for line in common_texts]  # convert corpus to BoW format
      >>>
      >>> model = LuceneBM25Model(dictionary=dictionary)  # fit model
      >>> vector = model[corpus[0]]  # apply model to the first corpus document
  
  References
  ----------
  .. [4] Kamphuis, C., de Vries, A. P., Boytsov, L., Lin, J. (2020). Which
     BM25 Do You Mean? `A Large-Scale Reproducibility Study of Scoring Variants
     <https://doi.org/10.1007/978-3-030-45442-5_4>`_. In: Advances in Information Retrieval.
     28–34.
class_docstr_tok: ["The","scoring","function","of","Apache","Lucene","8","[","4","]","_",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","Dictionary",">",">",">","from","gensim.models","import","LuceneBM25Model",">",">",">","from","gensim.test.utils","import","common_texts",">",">",">",">",">",">","dictionary","=","Dictionary","(","common_texts",")","#","fit","dictionary",">",">",">","corpus","=","[","dictionary.doc2bow","(","line",")","for","line","in","common_texts","]","#","convert","corpus","to","BoW","format",">",">",">",">",">",">","model","=","LuceneBM25Model","(","dictionary=dictionary",")","#","fit","model",">",">",">","vector","=","model","[","corpus","[","0","]","]","#","apply","model","to","the","first","corpus","document","References","--","--","--","--","--","..","[","4","]","Kamphuis",",","C.",",","de","Vries",",","A.","P.",",","Boytsov",",","L.",",","Lin",",","J",".","(","2020",")",".","Which","BM25","Do","You","Mean","?","`","A","Large-Scale","Reproducibility","Study","of","Scoring","Variants","<","https",":","\/\/doi.org\/10.1007\/978-3-030-45442-5_4",">","`","_",".","In",":","Advances","in","Information","Retrieval",".","28\u201334","."]
code: def precompute_idfs(self, dfs, num_docs):
      idfs = dict()
      for term_id, freq in dfs.items():
          idf = math.log(num_docs + 1.0) - math.log(freq + 0.5)
          idfs[term_id] = idf
      return idfs
  
imports: from abc import ABCMeta, abstractmethod
  from collections import defaultdict
  import logging
  import math
  from gensim import interfaces, utils
  import numpy
label_desc: Use image node_id 2 for calling the LuceneBM25Model obj's underlying member method code with example usage: obj.precompute_idfs(dfs, num_docs) and returns: idfs