lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@hoplahup.net>
Subject Re: Are Okapi BM25 scores normalized into 0 and 1 ?
Date Fri, 29 Apr 2011 11:47:54 GMT
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 <patrick.diviacco@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


Mime
View raw message