Page MenuHomePhabricator

Adapt hasrecommendation to filter by score and possibly rank by score
Closed, ResolvedPublic3 Estimated Story Points

Description

In T401021#11193688 it was discussed that possibly the hasrecommendation keyword could be adapted to allow filtering by confidence score.

Currently recommendation weighted_tags are just encoded as a binary flag:

  • prefix: recommendation.$type (e.g. recommendation.tone)
  • tag: exists (generally hardcoded, could also be a place where to add some variation if needed in the future)
  • score: null (defaults to the lowest score possible)

It is probable that some models may have a confidence score that could be useful to store and query using the hasrecommendation keyword. It might bring flexibility at query time allowing to adjust some threshold on a per query/wiki basis.

The syntax could look like this: hasrecommendation:tone>0.3.

It could also be interesting to evaluate if the hasrecommendation keyword should influence ranking based on this score. The idea needs to be validated but the assumption is that it could help to favor article that are less likely to be false-positives.
We could leave hasrecommendation as a filter only keyword but enable ranking if some weight is provided in the query:

  • hasrecommendation:tone>0.5: filter pages
  • hasrecommendation:tone^1.0>0.5 or hasrecommendation:tone^1.0: filter & rank pages with a tone recommendation using a weight of 1.0

AC:

  • hasrecommentation has a way to filter by score
  • hasrecommendation can rank pages when provided a weight hasrecommendation:tone^0.4
  • other keywords like articletopic/articlecountry should also support this new weight syntax

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Obviously let's keep this focused on tone-check but just reminding of our related use-case for a potential time topic filter where you'd do something like: articletopic:time>1960 (T397375).

pfischer set the point value for this task to 3.Sep 22 2025, 3:42 PM

Change #1191677 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/CirrusSearch@master] Allow to boost articleprediction keywords

https://gerrit.wikimedia.org/r/1191677

Change #1191678 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/CirrusSearch@master] hasrecommendation: allow filtering by score

https://gerrit.wikimedia.org/r/1191678

Change #1191677 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Allow to boost articleprediction keywords

https://gerrit.wikimedia.org/r/1191677

Change #1191678 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] hasrecommendation: allow filtering by score

https://gerrit.wikimedia.org/r/1191678

Change #1192189 had a related patch set uploaded (by DCausse; author: DCausse):

[mediawiki/extensions/CirrusSearch@master] Allow hasrecommendation to rank suggestions

https://gerrit.wikimedia.org/r/1192189

Change #1192189 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Allow hasrecommendation to rank suggestions

https://gerrit.wikimedia.org/r/1192189