Index: chrome/browser/history/scored_history_match.h |
diff --git a/chrome/browser/history/scored_history_match.h b/chrome/browser/history/scored_history_match.h |
index 15a37e7bd73673dc4efe2ca93a5e29a06d3e8d59..83de38a1dd2a740425f8d56e82b52761c8dd111e 100644 |
--- a/chrome/browser/history/scored_history_match.h |
+++ b/chrome/browser/history/scored_history_match.h |
@@ -29,6 +29,12 @@ class ScoredHistoryMatch : public history::HistoryMatch { |
// expected to deliver (at minimum) to this class. |
static const size_t kMaxVisitsToScore; |
+ // ScoreMaxRelevance maps from an intermediate-score to the maximum |
+ // final-relevance score given to a URL for this intermediate score. |
+ // This is used to store the score ranges of HQP relevance buckets. |
+ // Please see GetFinalRelevancyScore() for details. |
+ typedef std::pair<double, int> ScoreMaxRelevance; |
+ |
ScoredHistoryMatch(); // Required by STL. |
// Creates a new match with a raw score calculated for the history item |
@@ -83,6 +89,7 @@ class ScoredHistoryMatch : public history::HistoryMatch { |
private: |
friend class ScoredHistoryMatchTest; |
+ FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, GetFinalRelevancyScore); |
FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringBookmarks); |
FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringDiscountFrecency); |
FRIEND_TEST_ALL_PREFIXES(ScoredHistoryMatchTest, ScoringScheme); |
@@ -127,10 +134,18 @@ class ScoredHistoryMatch : public history::HistoryMatch { |
const VisitInfoVector& visits); |
// Combines the two component scores into a final score that's |
- // an appropriate value to use as a relevancy score. |
+ // an appropriate value to use as a relevancy score. Scoring buckets are |
+ // specified through |hqp_relevance_buckets|. Please see the function |
+ // implementation for more details. |
static float GetFinalRelevancyScore( |
float topicality_score, |
- float frequency_score); |
+ float frequency_score, |
+ const std::vector<ScoreMaxRelevance>& hqp_relevance_buckets); |
+ |
+ // Initializes the HQP experimental params, |
Mark P
2015/02/18 00:03:32
nit: should this be a ":" or "("/")", not a ","?
Ashok vardhan
2015/02/18 01:11:21
Done.
|
+ // |hqp_experimental_scoring_enabled_|, |topicality_threshold_| and |
+ // |hqp_relevance_buckets_| specified through omnibox field trials. |
Mark P
2015/02/18 00:03:32
You missed this earlier comment:
By the way, this
Ashok vardhan
2015/02/18 01:11:21
Done.
|
+ static void InitializeHQPExperimentalParams(); |
// Sets |also_do_hup_like_scoring_|, |
// |max_assigned_score_for_non_inlineable_matches_|, |bookmark_value_|, |
@@ -200,6 +215,20 @@ class ScoredHistoryMatch : public history::HistoryMatch { |
// will get demoted later in HistoryQuickProvider to non-inlineable scores. |
// Set to -1 to indicate no maximum score. |
static int max_assigned_score_for_non_inlineable_matches_; |
+ |
+ // True, if we enable hqp experimental scoring. |
Mark P
2015/02/18 00:03:32
nit:
True, if we enable hqp experimental scoring.
Ashok vardhan
2015/02/18 01:11:21
Done.
|
+ static bool hqp_experimental_scoring_enabled_; |
+ |
+ // |topicality_threshold_| is used to control the topicality scoring. |
+ // If |topicality_threshold_| > 0, then URLs with topicality-score < threshold |
+ // are given score 0. By default it is initalized to -1. |
Mark P
2015/02/18 00:03:32
"score of 0" or "topicality score of 0"? I think
Ashok vardhan
2015/02/18 01:11:21
Done.
|
+ static float topicality_threshold_; |
+ |
+ // |hqp_relevance_buckets_| gives mapping from (topicality*frequency) |
+ // to the final relevance scoring. Please see GetFinalRelevancyScore() |
+ // for more details and scoring method. |
+ static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_; |
+ |
}; |
typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches; |