]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1549505: add flag to tweak popularity-adjusted relevance
authorGalen Charlton <gmc@esilibrary.com>
Fri, 11 Mar 2016 18:27:03 +0000 (13:27 -0500)
committerKathy Lussier <klussier@masslnc.org>
Fri, 29 Jul 2016 20:56:11 +0000 (16:56 -0400)
commit1fd8103bf33430fe0b4b5ae8d2b2b051802ac473
tree67fc437992e33367a45fa03d5427b3b0cb3e9519
parentd4d2f42e8674f93284d2932e171bf9a4f9cc8cf4
LP#1549505: add flag to tweak popularity-adjusted relevance

This adds a new global_flag, search.max_popularity_importance_multiplier,
to control the factor by which popularity affects Popularity Adjusted
Relevance ranking.

The value should be a decimal number, typically between 1.0 and 2.0:

* 1.0 be would be equivalent to not adjusting relevance for popularity
  at all.
* 1.1 would mean that the multiplier would range from 1 (for zero
  popularity) to 1.1 (for maximum popularity), for a maximum boost of
  10% of the base relevance value of the record.

What's happening in the code:

Scale the 0-5 effect of popularity badges by providing a multiplier
for the badge average based on the overall maximum multiplier.  Two
examples, comparing the effect to the default $max_mult value of 2.0,
which causes a $adjusted_scale value of 0.2:

 * Given the default $max_mult of 2.0, the value of
   $adjusted_scale will be 0.2 [($max_mult - 1.0) / 5.0].
   For a record whose average badge score is the maximum
   of 5.0, that would make the relevance multiplier be
   2.0:
      1.0 + (5.0 [average score] * 0.2 [ $adjusted_scale ],
   This would have the effect of doubling the effective
   relevance of highly popular items.

 * Given a $max_mult of 1.1, the value of $adjusted_scale
   will be 0.02, meaning that the average badge value will be
   multiplied by 0.02 rather than 0.2, then added to 1.0 and
   used as a multiplier against the base relevance.  Thus a
   change of at most 10% to the base relevance for a record
   with a 5.0 average badge score. This will allow records
   that are naturally very relevant to avoid being pushed
   below badge-heavy records.

 * Given a $max_mult of 3.0, the value of $adjusted_scale
   will be 0.4, meaning that the average badge value will be
   multiplied by 0.4 rather than 0.2, then added to 1.0 and
   used as a multiplier against the base relevance. Thus a
   change of as much as 200% to (or three times the size of)
   the base relevance for a record with a 5.0 average badge
   score.  This in turn will cause badges to outweigh
   relevance to a very large degree.

The maximum badge multiplier can be set to a value less than
1.0; this would have the effect of making less popular items
show up higher in the results.  While this is not a likely
option for production use, it could be useful for identifying
interesting long-tail hits, particularly in a database
where enough badges are configured so that very few records
have an average badge score of zero.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.statisitcal-ratings.sql