如何标准化 Lucene 分数? [英] How to normalize Lucene scores?

查看:29
本文介绍了如何标准化 Lucene 分数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 Lucene 分数标准化为 0 到 1 之间.

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.

但是,请注意,标准化分数只能用于比较单个查询的结果.比较来自 2 个不同查询的结果的分数(标准化与否)是不正确的.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆