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

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 mark comments. 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..5ffa73c4caf5d786f9485a110bf570240c2999da 100644
--- a/chrome/browser/history/scored_history_match.h
+++ b/chrome/browser/history/scored_history_match.h
@@ -29,6 +29,11 @@ class ScoredHistoryMatch : public history::HistoryMatch {
// expected to deliver (at minimum) to this class.
static const size_t kMaxVisitsToScore;
+ // ScoreMaxRelevance maps from intermediate-score to the final-relevance
Mark P 2015/02/14 01:27:14 from -> from an to the -> to the maximum
Ashok vardhan 2015/02/17 01:23:53 Done.
+ // score given to URL. This is used to store the score ranges of HQP relevance
Mark P 2015/02/14 01:27:14 to URL -> to a URL for this intermediate score.
Ashok vardhan 2015/02/17 01:23:53 Done.
+ // 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 +88,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 +133,34 @@ 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 function
Mark P 2015/02/14 01:27:14 see -> see the
Ashok vardhan 2015/02/17 01:23:52 Done.
+ // 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/14 01:27:14 This comment is a verb, implying it should go next
Ashok vardhan 2015/02/17 01:23:53 Done.
+ // If the experimental scoring is enabled, it sets:
Mark P 2015/02/14 01:27:14 By the way, this comment is wrong as written. In
+ //
+ // 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.
+ static bool hqp_experimental_scoring_enabled_;
+ static float topicality_threshold_;
+ static std::vector<ScoreMaxRelevance>* hqp_relevance_buckets_;
+
+ static 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