Menu

Question about combine queries

Galago
2018-01-30
2018-02-01
  • Anton van der Vegt

    I am trying to clarify the action of multiple weighted combine queries. Can you remove the nesting, as I have done below, and get the same result, or does the number of terms within each #combine matter. i.e. are these queries equivalent:

    query 1:

    #combine:0=0.25:1=0.75 (
        #combine(t1 t2 ) 
        #combine:0=0.2:1=0.5:3=0.3(
            #combine(t3 t4 t5) 
            #combine(t6 t7) 
            #combine(t8 t9 t10 t11 t12)
        )
    )
    

    Query 2:

    #combine:0=0.25:1=0.15:2=0.375:3=0.225(
        #combine(t1 t2 )
        #combine(t3 t4 t5) 
        #combine(t6 t7) 
        #combine(t8 t9 t10 t11 t12)
    )
    
     
  • Lemur Project

    Lemur Project - 2018-01-31

    The two query forms are the same.

    Yes, the number of terms makes a difference. By default, if no weights are specifically given for terms in the #combine, the resulting weights will simply be equally assigned amongst the terms.

    Using Galago batch-search in verbose mode and terms from a TREC AP89 index gives the following results for your two query versions. The full query translations are not included to save space. Note the #combine weight indices are printed in lexographic rather than numeric order; a little annoying but not significant. Also note, some transformed weights differ slightly between versions. I believe this is nothing more than some print format rounding differences.

    Jan 31, 2018 2:43:17 PM org.lemurproject.galago.core.tools.apps.BatchSearch run
    INFO: RUNNING: Q1 : #combine:0=0.25:1=0.75(
                        #combine(celluloid torch)
                            #combine:0=0.2:1=0.5:2=0.3(
                               #combine(full metal jacket)
                               #combine(60s films)
                               #combine(baltimore danny devito richard dreyfus)
                            )
                        )
    Jan 31, 2018 2:43:18 PM org.lemurproject.galago.core.tools.apps.BatchSearch run
    INFO: Transformed Query:
    #combine:0=0.125:1=0.125:10=0.044999999999999984:11=0.044999999999999984:2=0.04999999999999999:3=0.04999999999999999:4=0.04999999999999999:5=0.18749999999999994:6=0.18749999999999994:7=0.044999999999999984:8=0.044999999999999984:9=0.044999999999999984:w=1.0(
    ...
    )
    
    Q1 Q0 AP890101-0001 1 -7.31621026 galago
    Q1 Q0 AP890202-0249 2 -9.46009468 galago
    Q1 Q0 AP890125-0248 3 -9.65291220 galago
    Q1 Q0 AP890116-0178 4 -9.77175023 galago
    Q1 Q0 AP890105-0063 5 -9.81855576 galago
    Q1 Q0 AP890110-0244 6 -9.83938520 galago
    Q1 Q0 AP890121-0045 7 -9.90019963 galago
    Q1 Q0 AP890116-0181 8 -9.97132285 galago
    Q1 Q0 AP890123-0219 9 -10.02444969 galago
    Q1 Q0 AP890203-0123 10 -10.03943609 galago
    
    Jan 31, 2018 2:43:18 PM org.lemurproject.galago.core.tools.apps.BatchSearch run
    INFO: RUNNING: Q2 : #combine:0=0.25:1=0.15:2=0.375:3=0.225(
                        #combine (celluloid torch)
                        #combine (full metal jacket)
                        #combine (60s films)
                        #combine (baltimore danny devito richard dreyfus)
                      )
    Jan 31, 2018 2:43:18 PM org.lemurproject.galago.core.tools.apps.BatchSearch run
    INFO: Transformed Query:
    #combine:0=0.125:1=0.125:10=0.045000000000000005:11=0.045000000000000005:2=0.049999999999999996:3=0.049999999999999996:4=0.049999999999999996:5=0.1875:6=0.1875:7=0.045000000000000005:8=0.045000000000000005:9=0.045000000000000005:w=1.0(
    ...    
    )
    
    Q2 Q0 AP890101-0001 1 -7.31621026 galago
    Q2 Q0 AP890202-0249 2 -9.46009468 galago
    Q2 Q0 AP890125-0248 3 -9.65291220 galago
    Q2 Q0 AP890116-0178 4 -9.77175023 galago
    Q2 Q0 AP890105-0063 5 -9.81855576 galago
    Q2 Q0 AP890110-0244 6 -9.83938520 galago
    Q2 Q0 AP890121-0045 7 -9.90019963 galago
    Q2 Q0 AP890116-0181 8 -9.97132285 galago
    Q2 Q0 AP890123-0219 9 -10.02444969 galago
    Q2 Q0 AP890203-0123 10 -10.03943609 galago
    
     
  • Anton van der Vegt

    Many thanks, that is crystal clear.

     

Log in to post a comment.