Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7480

Wrong Formula in LMDirichletSimilarity

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      It seems that LMDirichletSimilarity only calculates "score" method if the term occurs in the document. Otherwise, in line 389 of BooleanWeight (Lucene 6.2.0) subScorer becomes null, and thus the clause is not added to the optional list in order to be scored.

      However, in the original formula of LM (http://www.stat.uchicago.edu/~lafferty/pdf/smooth-tois.pdf, formula 6), we have "n log a_d" (n is the number of query terms). Therefore, even for the query terms not present in the document a "log a_d" must be added to the final score.

      But the implementation of LMDirichletSimilarity adds "log a_d" to the score in the "score" method, and therefore it is only added to the final score for the query terms present in the document.

      This can worsen the retrieval results compared to the correct formula. I tried to correct this for myself but because of the plenty of "final" methods and classes, I was not successful. Please, check the problem and solve it if approved, and also please tell me how I can correct it before a new release is published.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shayantabrizi Shayan Tabrizi
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: