Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TFLite language detection #19098

Open
atuchin-m opened this issue Oct 29, 2021 · 0 comments
Open

Support TFLite language detection #19098

atuchin-m opened this issue Oct 29, 2021 · 0 comments
Labels
brave-translate OS/Android Fixes related to Android browser functionality OS/Desktop

Comments

@atuchin-m
Copy link
Contributor

atuchin-m commented Oct 29, 2021

Description

Before r97 chromium use CLD3 library to detect page language.
In r97 the feature to use TFLite Language Detection instead was enabled by default:
https://chromium-review.googlesource.com/c/chromium/src/+/3145677

Right now Brave can't use the same model as Chrome - it doesn't' have a permissive license and it's downloaded from google backend protected by Chrome API key.
If we want to support that feature we have to deal with that issues somehow (prepare our own model?).

Steps to Reproduce

  1. Run browser with --enable-features=TFLiteLanguageDetectionEnabled;
  2. Wait a few minutes if it's the first run for the profile;
  3. Go to some site (i.e. https://example.com/).

Actual result:

  1. Browser can't correctly detect the page language using the language model. Check brave://translate-internals/#detection-logs for details (you see Model Language: und, Model version : TFLite_*, Model score: 0.0)
  2. If it's a foreign language you will not see a translate bubble (suggest installing google translate extension or translating the page).

Expected result:

  1. Browser can correctly detect the page language using model
  2. The bubble should be shown (if you didn't disable it before).

Reproduces how often:

Easily reproduced.

Desktop Brave version:

Brave 1.33.37 Chromium: 95.0.4638.54 (Official Build) nightly (64-bit)
Revision d31a821ec901f68d0d34ccdbaea45b4c86ce543e-refs/branch-heads/4638@{#871}
OS Windows 10 Version 21H1 (Build 19043.1288)

Version/Channel Information:

All recent versions and channels are affected.

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? no;
  • Does the issue resolve itself when disabling Brave Rewards? no;
  • Is the issue reproducible on the latest version of Chrome? no for Chrome, yes for Chromium.

Miscellaneous Information:

It isn't a bug for end users because the language detection works fine using the old engine (CLD3).

Screenshot Brave:

image

Screenshot Chrome:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brave-translate OS/Android Fixes related to Android browser functionality OS/Desktop
Projects
None yet
Development

No branches or pull requests

1 participant