Rescoring from 0 - full

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Rescoring from 0 - full

Dariusz Wojtas
Hi,
When I use boosting fuctionality, it is always about adding or
multiplicating the score calculated in the 'q' param.
I mau use function queries inside 'q', but this may hit performance on
calling multiple nested functions.
I thaught that 'rerank' could help, but it is still about changing the
original score, not full calculation.

How can take full control on score in rerank? Is it possible?

Best regards,
Dariusz Wojtas
Reply | Threaded
Open this post in threaded view
|

Re: Rescoring from 0 - full

Emir Arnautović
Hi Dariusz,
You could use fq for filtering (can disable caching to avoid polluting filter cache) and q=*:*. That way you’ll get score=1 for all doc and can rerank. The issue with this approach is that you rerank top N and without score they wouldn’t be ordered so it is no-go.
What you could do (did not try) in rescoring divide by score (not sure if can access calculated but could calculate) to eliminate score.

HTH,
Emir

> On 20 Sep 2017, at 21:38, Dariusz Wojtas <[hidden email]> wrote:
>
> Hi,
> When I use boosting fuctionality, it is always about adding or
> multiplicating the score calculated in the 'q' param.
> I mau use function queries inside 'q', but this may hit performance on
> calling multiple nested functions.
> I thaught that 'rerank' could help, but it is still about changing the
> original score, not full calculation.
>
> How can take full control on score in rerank? Is it possible?
>
> Best regards,
> Dariusz Wojtas

Reply | Threaded
Open this post in threaded view
|

Re: Rescoring from 0 - full

Diego Ceccarelli (BLOOMBERG/ LONDON)
In reply to this post by Dariusz Wojtas
Hi Dariusz,
If you use *:* you'll rerank only the top N random documents, as Emir said, that will not produce interesting results probably.
If you want to replace the original score, you can take a look at the learning to rank module [1], that would allow you to reassign a
new score to the top N documents returned by your query and then reorder them based on that (ignoring the original score, if you want).

Cheers,
Diego  

[1] https://cwiki.apache.org/confluence/display/solr/Learning+To+Rank

From: [hidden email] At: 09/21/17 08:49:13
To: [hidden email]
Subject: Re: Rescoring from 0 - full

Hi Dariusz,
You could use fq for filtering (can disable caching to avoid polluting filter cache) and q=*:*. That way you’ll get score=1 for all doc and can rerank. The issue with this approach is that you rerank top N and without score they wouldn’t be ordered so it is no-go.
What you could do (did not try) in rescoring divide by score (not sure if can access calculated but could calculate) to eliminate score.

HTH,
Emir

> On 20 Sep 2017, at 21:38, Dariusz Wojtas <[hidden email]> wrote:
>
> Hi,
> When I use boosting fuctionality, it is always about adding or
> multiplicating the score calculated in the 'q' param.
> I mau use function queries inside 'q', but this may hit performance on
> calling multiple nested functions.
> I thaught that 'rerank' could help, but it is still about changing the
> original score, not full calculation.
>
> How can take full control on score in rerank? Is it possible?
>
> Best regards,
> Dariusz Wojtas


Reply | Threaded
Open this post in threaded view
|

Re: Rescoring from 0 - full

Erick Erickson
Sure, you can take full control of the scoring, just write a custom similarity.

What's not at all clear is why you want to. RerankQParserPlugin will
re-rank the to N documents by pushing them through a different query,
can you make that work?

Best,
Erick



On Thu, Sep 21, 2017 at 4:20 AM, Diego Ceccarelli (BLOOMBERG/ LONDON)
<[hidden email]> wrote:

> Hi Dariusz,
> If you use *:* you'll rerank only the top N random documents, as Emir said, that will not produce interesting results probably.
> If you want to replace the original score, you can take a look at the learning to rank module [1], that would allow you to reassign a
> new score to the top N documents returned by your query and then reorder them based on that (ignoring the original score, if you want).
>
> Cheers,
> Diego
>
> [1] https://cwiki.apache.org/confluence/display/solr/Learning+To+Rank
>
> From: [hidden email] At: 09/21/17 08:49:13
> To: [hidden email]
> Subject: Re: Rescoring from 0 - full
>
> Hi Dariusz,
> You could use fq for filtering (can disable caching to avoid polluting filter cache) and q=*:*. That way you’ll get score=1 for all doc and can rerank. The issue with this approach is that you rerank top N and without score they wouldn’t be ordered so it is no-go.
> What you could do (did not try) in rescoring divide by score (not sure if can access calculated but could calculate) to eliminate score.
>
> HTH,
> Emir
>
>> On 20 Sep 2017, at 21:38, Dariusz Wojtas <[hidden email]> wrote:
>>
>> Hi,
>> When I use boosting fuctionality, it is always about adding or
>> multiplicating the score calculated in the 'q' param.
>> I mau use function queries inside 'q', but this may hit performance on
>> calling multiple nested functions.
>> I thaught that 'rerank' could help, but it is still about changing the
>> original score, not full calculation.
>>
>> How can take full control on score in rerank? Is it possible?
>>
>> Best regards,
>> Dariusz Wojtas
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Rescoring from 0 - full

Dariusz Wojtas
Hi,
Your answers have helped me a lot.
I've managed to use the LTRQParserPlugin and it does what I need. Full
control over scoring with it's re-ranking functionality.
I define my custom features and may pass custom params to them using the
"efi.*" syntax.
Is there something similar to define weights in the model that uses these
features?
Can I have single model, byt pass feature weights in each request?
How do I pass my custom weights with each request in the example below?

{
  "store" : "myFeaturesStore",
  "name" : "myModel",
  "class" : "org.apache.solr.ltr.model.LinearModel",
  "features" : [
    { "name" : "scorePersonalId" },
    { "name" : "originalScore" }
  ],
  "params" : {
    "weights" : {
      "scorePersonalId" : 0.9,
      "originalScore" : 0.1
    }
  }
}

I am using SOLR 6.6, soon switching to 7.0

Best regards,
Dariusz Wojtas


On Thu, Sep 21, 2017 at 5:18 PM, Erick Erickson <[hidden email]>
wrote:

> Sure, you can take full control of the scoring, just write a custom
> similarity.
>
> What's not at all clear is why you want to. RerankQParserPlugin will
> re-rank the to N documents by pushing them through a different query,
> can you make that work?
>
> Best,
> Erick
>
>
>
> On Thu, Sep 21, 2017 at 4:20 AM, Diego Ceccarelli (BLOOMBERG/ LONDON)
> <[hidden email]> wrote:
> > Hi Dariusz,
> > If you use *:* you'll rerank only the top N random documents, as Emir
> said, that will not produce interesting results probably.
> > If you want to replace the original score, you can take a look at the
> learning to rank module [1], that would allow you to reassign a
> > new score to the top N documents returned by your query and then reorder
> them based on that (ignoring the original score, if you want).
> >
> > Cheers,
> > Diego
> >
> > [1] https://cwiki.apache.org/confluence/display/solr/Learning+To+Rank
> >
> > From: [hidden email] At: 09/21/17 08:49:13
> > To: [hidden email]
> > Subject: Re: Rescoring from 0 - full
> >
> > Hi Dariusz,
> > You could use fq for filtering (can disable caching to avoid polluting
> filter cache) and q=*:*. That way you’ll get score=1 for all doc and can
> rerank. The issue with this approach is that you rerank top N and without
> score they wouldn’t be ordered so it is no-go.
> > What you could do (did not try) in rescoring divide by score (not sure
> if can access calculated but could calculate) to eliminate score.
> >
> > HTH,
> > Emir
> >
> >> On 20 Sep 2017, at 21:38, Dariusz Wojtas <[hidden email]> wrote:
> >>
> >> Hi,
> >> When I use boosting fuctionality, it is always about adding or
> >> multiplicating the score calculated in the 'q' param.
> >> I mau use function queries inside 'q', but this may hit performance on
> >> calling multiple nested functions.
> >> I thaught that 'rerank' could help, but it is still about changing the
> >> original score, not full calculation.
> >>
> >> How can take full control on score in rerank? Is it possible?
> >>
> >> Best regards,
> >> Dariusz Wojtas
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Rescoring from 0 - full

alessandro.benedetti
The weights you express could flag a probabilistic view or your final score.
The model you quoted will calculate the final score as :
0.9*scorePersonalId +0.1* originalScore

The final score will NOT necessarily be  0<finalScore<1 .

If that was not the case, I see little benefit in having the weights in a
model to be passed at query time.
The entire of LTR sense is to calculate those weights to optimise your
ranking function, sure you can have multiple models, trained on different
datasets, but each model will be the fixed ( and described by the json).

If you want to play with weights you can potentially take a look to the ^=
boost operator (which builds constant score queries) in cooperation with
dismax/edismax[1] qf and different boosts.


[1]
https://lucene.apache.org/solr/guide/6_6/the-dismax-query-parser.html#the-dismax-query-parser





-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io