Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: chrome/browser/history/scored_history_match.h

Issue 905023003: Adding knobs on HQP provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing bart comments. PTAL. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..52fac2db2a5188c24446caf9b3a6cdabb3827d37 100644
--- a/chrome/browser/history/scored_history_match.h
+++ b/chrome/browser/history/scored_history_match.h
@@ -83,6 +83,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);
@@ -128,9 +129,34 @@ class ScoredHistoryMatch : public history::HistoryMatch {
// Combines the two component scores into a final score that's
// an appropriate value to use as a relevancy score.
+ typedef std::pair<double, int> ScoreMaxRelevance;
+
static float GetFinalRelevancyScore(
float topicality_score,
- float frequency_score);
+ float frequency_score,
+ std::vector<ScoreMaxRelevance>& hqp_relevance_buckets);
+
+ // Initializes the HQP experimental params.
+ // If the experimental scoring is enabled, it sets:
+ //
+ // 1. hqp_experimental to true. Default value is set to false.
+ //
+ // 2. It initializes the topicality_threshold_, and hqp_scoring from the
+ // finch experiment params.
+ //
+ // 3. topicality_threshold_ is used to control the topicality scoring.
+ // If topicality_threshold > 0, then URLs with topicality score < threshold,
+ // are given score 0. It is initalized to -1;
+ //
+ // 4. hqp_relevance_buckets_, buckets that gives the mapping from
+ // (topicality*frequency) to the final relevance scoring.
+ // Please see GetFinalRelevancyScore() for more details and scoring method.
+ bool hqp_experimental_scoring_enabled_;
+ float topicality_threshold_;
+
+ std::vector<ScoreMaxRelevance> hqp_relevance_buckets_;
+
+ void InitializeHQPExperimentalParams();
// Sets |also_do_hup_like_scoring_|,
// |max_assigned_score_for_non_inlineable_matches_|, |bookmark_value_|,
« no previous file with comments | « no previous file | chrome/browser/history/scored_history_match.cc » ('j') | chrome/browser/history/scored_history_match.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698