如何标准化Lucene分数? [英] How to normalize Lucene scores?
本文介绍了如何标准化Lucene分数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要对0到1之间的Lucene分数进行归一化.
I need to normalize the Lucene scores between 0 and 1.
例如,随机查询返回以下分数...
For example, a random query returns the following scores...
8.864665
2.792687
2.792687
2.792687
2.792687
0.49009037
0.33730242
0.33730242
0.33730242
0.33730242
最高分是多少? 10.0吗?
What's the biggest score ? 10.0 ?
谢谢
推荐答案
您可以将所有分数与最大分数相除,以得到0到1之间的分数.
You can divide all scores with the maximum score to get scores between 0 and 1.
但是,请注意,标准化分数仅用于比较单个查询的结果.比较两个不同查询的结果得分(归一化与否)是不正确的.
However, please note that the normalised scores should be used to compare the results of a single query only. It is not correct to compare the scores (normalised or not) of results from 2 different queries.
这篇关于如何标准化Lucene分数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文