New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 596537 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Add a new Histogram for detected page language

Project Member Reported by ainslie@chromium.org, Mar 21 2016

Issue description

The idea is to record, for every page load, the result of CLD2 (client-side language detection that we use to trigger translation prompts today). 

Rationale: 
Chrome needs to know what language(s) people read/speak before we can actually offer useful, respectful (language) assistance. This histogram will help us understand how far off we are (ex: on Android where we inherit OS display language) and how much opportunity exists for translate to be useful.
https://docs.google.com/presentation/d/1_Tc1wMhNJ0WwBki1Jd6EkvilWPsqHMiMweMkn7XiLWo/edit#slide=id.p



 

Comment 1 by rsesek@chromium.org, Mar 21 2016

Labels: -OS-Mac

Comment 2 by n...@chromium.org, Mar 21 2016

Cc: twelling...@chromium.org
Cc: andrewhayden@chromium.org riesa@chromium.org
I think you want this code for your histogram:
https://code.google.com/p/chromium/codesearch#chromium/src/components/translate/content/browser/content_translate_driver.cc&sq=package:chromium&type=cs&l=243&rcl=1458574421

(ContentTranslateDriver::OnLanguageDetermined)

You definitely want to gather this in the browser process for ease of use, since the renderer doesn't guarantee that the histograms will get flushed back to the browser process in a timely manner (or at all).

I've CC'd myself, feel free to bug me if you run into issues.

CC riesa@, the owner of CLD2.

Comment 4 by groby@chromium.org, Mar 22 2016

You don't want to collect the metrics content side, since this is a Chrome, not a translate metric. But you're in luck, browser already subclasses translate::ContentTranslateDriver::Observer. 

You want to override OnLanguageDetermine on browser - Translate's observer API is overriden here: https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/browser.h&rcl=1458646239&l=738

Alternatively, because we never do things in just one way, listen to NOTIFICATION_TAB_LANGUAGE_DETERMINED. But the first solution is probably the better one. 



Comment 5 by groby@chromium.org, Mar 22 2016

Status: Available (was: Unconfirmed)
Oh, and before I forget: We do have IIRC metrics for pages that are translated (i.e. that are different from the UI language). We can _probably_ derive this all from existing UMA data, if we dig. 
Owner: rkaplow@chromium.org
Per discussion with riesa@ today, it'd be neat to also add a histogram for the CLD2-returned confidence/probability for the top language. That might give us a better sense for when/where detection is getting tripped up or people are reading pages with multiple languages.

Assigning to rkaplow@ for now since he may be able to pick this up in the short term. 


Status: Assigned (was: Available)
Cc: asvitk...@chromium.org
Hi, I wrote the CL and only at the end read the discussion here - oops. 
https://codereview.chromium.org/1847713002/

SO I took a different tack and did it close to the CLD2 analysis. This let me easily access the probability distribution data as well.

This gets called through the TranslateHelper, which looks like it is on the renderer. I didn't think there was a problem with adding the metrics from the renderer, maybe +alexei if he has any thoughts on that.

Even if this isn't what you suggested, I figured I would send it off anyways since it was already written - no worries either way.

The histogram you've added there should work by happy coincidence because of TranslateHelper::RecordLanguageDetectionTiming() here:
https://code.google.com/p/chromium/codesearch#chromium/src/components/translate/content/renderer/translate_helper.cc

This triggers a flush to the browser process right away. I had forgotten this code was in there. So I guess as long as you're tightly coupled to that same code timing it will all just work out :)
For folks following along, these are the new histograms:
Translate.CLD2LanguageAccuracy
Translate.CLD2LanguageDetected
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eb4ffca7b23f6f8d1a0af549bfc18e31a3a0e331

commit eb4ffca7b23f6f8d1a0af549bfc18e31a3a0e331
Author: rkaplow <rkaplow@chromium.org>
Date: Fri Apr 01 14:04:15 2016

Add histograms to measure CLD2 language detection as well as the accuracy of the chosen detection.

BUG= 596537 

Review URL: https://codereview.chromium.org/1847713002

Cr-Commit-Position: refs/heads/master@{#384575}

[modify] https://crrev.com/eb4ffca7b23f6f8d1a0af549bfc18e31a3a0e331/components/translate/core/language_detection/language_detection_util.cc
[modify] https://crrev.com/eb4ffca7b23f6f8d1a0af549bfc18e31a3a0e331/tools/metrics/histograms/histograms.xml

Labels: Merge-Request-50
Can I get this merged to M50? It is adding 2 extra histograms to track what languages are detected, request by ainsle@ and talo@

Comment 13 by tin...@google.com, Apr 4 2016

Labels: -Merge-Request-50 Merge-Approved-50 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M50 (branch: 2661)
Please merge your change to M50 branch 2661 by 5:00 PM PST today, 04/04/16 so we can take it for this week beta. Thank you. 
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 4 2016

Labels: -merge-approved-50 merge-merged-2661
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ddf07ff2b2eed462a4530f644e994af17e8aceab

commit ddf07ff2b2eed462a4530f644e994af17e8aceab
Author: Robert Kaplow <rkaplow@chromium.org>
Date: Mon Apr 04 20:49:22 2016

Add histograms to measure CLD2 language detection as well as the accuracy of the chosen detection.

BUG= 596537 

Review URL: https://codereview.chromium.org/1847713002

Cr-Commit-Position: refs/heads/master@{#384575}
(cherry picked from commit eb4ffca7b23f6f8d1a0af549bfc18e31a3a0e331)

Review URL: https://codereview.chromium.org/1860723002 .

Cr-Commit-Position: refs/branch-heads/2661@{#480}
Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081}

[modify] https://crrev.com/ddf07ff2b2eed462a4530f644e994af17e8aceab/components/translate/core/language_detection/language_detection_util.cc
[modify] https://crrev.com/ddf07ff2b2eed462a4530f644e994af17e8aceab/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)

Sign in to add a comment