Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11302

Flexible LTR model which uses DSL for describing the scoring function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • contrib - LTR
    • None

    Description

      We implment new LTR model which uses DSL for describing the scoring function. This model is inspired by the implementation of JavascriptCompiler which compiles javascript codes by using ANTLR and ASM. The syntax of our DSL is based on Java and FunctionQuery, and we can describe various models freely by using the DSL. Please see ltr/dsl/package-info.java for more details.

      The configuration of our model looks like belows:

      {
        "class":"org.apache.solr.ltr.model.DSLModel",
        "name":"dslmodel",
        "features":[
          {"name":"popularity"},
          {"name":"normHits"},
          {"name":"isTrendy"}
        ],
        "params":{
          "dsl": "(0.2 * popularity / 10 + 0.3 * normHits) * if(isTrendy==1, 2.0, 1.0)"
        }
      }
      

      This approach is similar to re-ranking with FunctionQuery, except that our model compiles the DSL into bytecodes on ahead and can calculate scores faster. In practice, the performance of the model is depended on the structure of formula. For example, if we convert existing models (i.e., LinearModel and MultipleAdditiveTreesModel) to DSLs and compare the performance (with large models), our model is 4.5x slower than LinearModel but 1.5x faster than MultipleAdditiveTreesModel.

      Attachments

        1. SOLR-11302_master.patch
          155 kB
          Yuki Yano

        Activity

          People

            Unassigned Unassigned
            yuyano Yuki Yano
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: