You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Patrick Diviacco <pa...@gmail.com> on 2011/04/28 13:49:25 UTC
Are Okapi BM25 scores normalized into 0 and 1 ?
Is Okapi BM25 (its implementation in Lucene:
nlp.uned.es/~jperezi/Lucene-BM25) returning back normalized query scores (in
between 0 and 1) ?
According to Okapi formula the final score should be normalized. Could you
give some information about that ?
thanks
Re: Are Okapi BM25 scores normalized into 0 and 1 ?
Posted by Paul Libbrecht <pa...@hoplahup.net>.
Patrick if the question is about the code snippert at the page you mention, which I copy below, I believe the answer is no and the author is aware of it since he is adding a comment about not-normalized in the second example.
ScoreDocs and TopDocs are not returning normalized scores.
Normalized scores tend to be rare in Lucene nowadays, I believe earlier strategy was to divide by max-score when the latter was bigger than 1.
paul
IndexSearcher searcher = new IndexSearcher("IndexPath");
//Load average length
BM25Parameters.load(avgLengthPath);
BM25BooleanQuery query = new BM25BooleanQuery("This is my Query",
"Search-Field",
new StandardAnalyzer());
TopDocs top = searcher.search(query, null, 10);
ScoreDoc[] docs = top.scoreDocs;
//Print results
for (int i = 0; i $<$ top.scoreDocs.length; i++) {
System.out.println(docs[i].doc + ":"+docs[i].score);
}
Le 29 avr. 2011 à 13:20, Patrick Diviacco a écrit :
> Can anybody provide me some information about it ? Even a small clue, I'm
> kinda stuck on this and the owner of the libraries do not answer emails.
>
> Thanks
>
>
> On 28 April 2011 13:49, Patrick Diviacco <pa...@gmail.com> wrote:
>
>> Is Okapi BM25 (its implementation in Lucene:
>> nlp.uned.es/~jperezi/Lucene-BM25) returning back normalized query scores
>> (in between 0 and 1) ?
>>
>> According to Okapi formula the final score should be normalized. Could you
>> give some information about that ?
>>
>> thanks
>>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Are Okapi BM25 scores normalized into 0 and 1 ?
Posted by Patrick Diviacco <pa...@gmail.com>.
Can anybody provide me some information about it ? Even a small clue, I'm
kinda stuck on this and the owner of the libraries do not answer emails.
Thanks
On 28 April 2011 13:49, Patrick Diviacco <pa...@gmail.com> wrote:
> Is Okapi BM25 (its implementation in Lucene:
> nlp.uned.es/~jperezi/Lucene-BM25) returning back normalized query scores
> (in between 0 and 1) ?
>
> According to Okapi formula the final score should be normalized. Could you
> give some information about that ?
>
> thanks
>
>
>