|
Albert
|
#include <albert/usagescoring.h>
Modifies match scores according to user usage history and preferences.
Public Member Functions | |
| double | modifiedMatchScore (const ItemKey &key, double match_score) const |
| Returns the modified match_score for an item identified by key. | |
| void | modifyMatchScores (const QString &extension_id, std::vector< albert::RankItem > &rank_items) const |
| Modifies the match score of rank_item for an item identified by key in-place. | |
Public Attributes | |
| bool | prioritize_perfect_match |
If true perfect matches should be prioritized even if their usage score is lower. | |
| double | memory_decay |
| The exponential decay applied to usage scores based on recency. | |
| std::shared_ptr< const std::unordered_map< ItemKey, double > > | usage_scores |
| The usage scores. | |
| double albert::UsageScoring::modifiedMatchScore | ( | const ItemKey & | key, |
| double | match_score | ||
| ) | const |
Returns the modified match_score for an item identified by key.
| void albert::UsageScoring::modifyMatchScores | ( | const QString & | extension_id, |
| std::vector< albert::RankItem > & | rank_items | ||
| ) | const |
Modifies the match score of rank_item for an item identified by key in-place.
| double albert::UsageScoring::memory_decay |
The exponential decay applied to usage scores based on recency.
This value adjusts the influence of recent item activations using a geometric weighting scheme: each activation contributes a weight of 1 / (memory_decay^recency). A value of 1.0 disables decay, assigning equal weight to all activations and the score of an item is the sum of its activations (Most Frequently Used). A value of 0.5 implies that for any activation a_i in history the sum of all older activations can not exceed the weight of a_i (Most Recently Used). Valid range: [0.5, 1.0]
| bool albert::UsageScoring::prioritize_perfect_match |
If true perfect matches should be prioritized even if their usage score is lower.
| std::shared_ptr<const std::unordered_map<ItemKey, double> > albert::UsageScoring::usage_scores |
The usage scores.