Chromium Code Reviews| Index: components/dom_distiller/content/renderer/distillability_agent.cc |
| diff --git a/components/dom_distiller/content/renderer/distillability_agent.cc b/components/dom_distiller/content/renderer/distillability_agent.cc |
| index f0ae4b511a4b0d86e8ea6bc99f5709f17e4d8d03..f2533e918ca6dcaf54417929263b10018f8c6bed 100644 |
| --- a/components/dom_distiller/content/renderer/distillability_agent.cc |
| +++ b/components/dom_distiller/content/renderer/distillability_agent.cc |
| @@ -93,10 +93,33 @@ bool IsDistillablePageAdaboost(WebDocument& doc, |
| features.mozScoreAllSqrt, |
| features.mozScoreAllLinear |
| ); |
| - bool distillable = detector->Classify(derived); |
| - bool long_article = long_page->Classify(derived); |
| + double score = detector->Score(derived) - detector->GetThreshold(); |
| + double long_score = long_page->Score(derived) - long_page->GetThreshold(); |
| + bool distillable = score > 0; |
| + bool long_article = long_score > 0; |
| bool blacklisted = IsBlacklisted(parsed_url); |
| + if (!features.isMobileFriendly) { |
| + int score_int = std::round(score * 100); |
| + if (score > 0) { |
| + UMA_HISTOGRAM_COUNTS_1000("DomDistiller.DistillabilityScoreNMF.Positive", |
| + score_int); |
| + } else { |
| + UMA_HISTOGRAM_COUNTS_1000("DomDistiller.DistillabilityScoreNMF.Negative", |
| + -score_int); |
| + } |
| + if (distillable) { |
|
rkaplow
2016/06/07 20:51:12
this is confusing me, since the above section says
wychen
2016/06/07 21:27:33
The long-page score is only relevant if the first
|
| + int long_score_int = std::round(long_score * 100); |
| + if (long_score > 0) { |
| + UMA_HISTOGRAM_COUNTS_1000("DomDistiller.LongArticleScoreNMF.Positive", |
| + long_score_int); |
| + } else { |
| + UMA_HISTOGRAM_COUNTS_1000("DomDistiller.LongArticleScoreNMF.Negative", |
| + -long_score_int); |
| + } |
| + } |
| + } |
| + |
| int bucket = static_cast<unsigned>(features.isMobileFriendly) | |
| (static_cast<unsigned>(distillable) << 1); |
| if (is_last) { |