Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: Language Detector API

590 views
Skip to first unread message

Deepti Bogadi

unread,
Apr 25, 2025, 4:58:12 PMApr 25
to blink-dev, Kenji Baheux, chrom...@google.com

Contact emails

dom...@chromium.org, fer...@chromium.org, kenji...@chromium.org, ay...@chromium.org, mem...@chromium.org, chris...@chromium.org, dbo...@chromium.org


Explainer

https://github.com/WICG/translation-api/blob/main/README.md


Specification

https://webmachinelearning.github.io/translation-api/#language-detector-api


Note that although the translator API and language detector APIs both live in a single specification, they can be implemented independently, and this Intent is only for the language detector API.


Summary

A JavaScript API for detecting the language of text, with confidence levels.



Blink component

Blink>AI>Language Detection


TAG review

https://github.com/w3ctag/design-reviews/issues/948


TAG review status

Issues addressed


The TAG had a number of questions and suggestions, particularly around API shape, all of which were addressed and incorporated into the design.


Origin Trial Name

Language Detector API


Chromium Trial Name

LanguageDetectionAPI


Origin Trial documentation link

https://github.com/WICG/translation-api/blob/main/README.md


WebFeature UseCounter name

kV8LanguageDetector_Detect_Method


Risks


Interoperability and Compatibility

This feature, like all built-in AI features, has inherent interoperability risks due to the use of AI models whose behavior is not fully specified. See some general discussion in https://www.w3.org/reports/ai-web-impact/#interop.


By providing a high-level API with clear output formats, as well as a capabilities API for detecting what a given browser supports, we believe we can guide web developers toward using the API in an interoperable way that does not depend on the specific models that a given browser or browser version uses.


Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1015)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/339)


Web developers: Positive (https://github.com/WICG/proposals/issues/147)


Other signals:


Ergonomics

This API will likely frequently be used in concert with the translator API (https://chromestatus.com/feature/5172811302961152).


The language detection is run on the main thread, the same as the browser's built-in language detection. The inference is fast enough that it is not a concern.



Activation

This feature would definitely benefit from having polyfills, backed by any of: cloud services, lazily-loaded on-device models using WebGPU, or the web developer's own server. We anticipate seeing an ecosystem of such polyfills grow as more developers experiment with this API.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

Basic tooling suffices



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

The WPTs test the API surface, but since no specific language is guaranteed to be supported, we cannot test the actual language detection. Some tests will need to be marked as optional as they assume certain language support. They also currently do not pass on wpt.fyi since it runs without a language detection model, so creation of LanguageDetector fails.


Flag name on about://flags

language-detection-api


Finch feature name

LanguageDetectionAPI


Rollout plan

Will ship enabled for all users


Requires code in //chrome?

False


Measurement

kV8AILanguageDetector_Detect_Method


Estimated milestones

Shipping on desktop

137

Origin trial desktop first

130

Origin trial desktop last

135

Origin trial extension 1 end milestone

138

DevTrial on desktop

129

Origin trial Android first

130

Origin trial Android last

135

DevTrial on Android

129

Origin trial WebView first

130

Origin trial WebView last

135



Anticipated spec changes

None but the API shape is designed with extensibility in mind


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6494349985841152?gate=5122129510268928


Links to previous Intent discussions

Intent to Prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/Ie46tc6_8so/m/eY1huFmOAAAJ

Intent to Experiment: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra-WvH-sxxWndwAWPLF3eEYqeLhXrz-VmZKH4Wxzbpse-Q%40mail.gmail.com

Intent to Extend Experiment 1: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAO4d-SsFc3ucbmasgZmWn4PE_TOMMnWZQCzrL%3DXbbo5tDxMSOg%40mail.gmail.com


This intent message was generated by Chrome Platform Status.

Alex Russell

unread,
Apr 28, 2025, 2:13:25 PMApr 28
to blink-dev, Deepti Bogadi, Kenji Baheux, chrom...@google.com
Hey Deepti,

Are you able to summarize developer feedback from the OT?

Best,

Alex

Deepti Bogadi

unread,
Apr 28, 2025, 7:35:05 PMApr 28
to Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com
Hi Alex,

Overall we have received positive feedback from the developers. A more recent snapshot of the quantitative feedback was shared at BlinkOn: bit.ly/blinkon-2025-builtin-ai (slide 34).

We are working with our partners who are excited to use this API. I am also sharing our latest OT feedback stats across various APIs.

Finally, from the latest OT sign up numbers, we were already order of magnitude above a typical OT which suggests lots of interest in what this API enables.

Hope this helps. Let me know if you have further questions.

Thanks,
Deepti

Chris Harrelson

unread,
Apr 30, 2025, 11:15:18 AMApr 30
to Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com
Hi, I see that Mozilla has published an explainer for an (alternate?) translation API. I realize that their explainer may not cover language detection, but language detection is part of a larger spec linked here that includes translation. Have you talked to them about it?

Also, is this intent just proposing to ship section 4 from the linked specification?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJcT_ZgG8%2BepW52jqPEbny4cCCYbSC9q6r8sw6uKmrw_gphpwA%40mail.gmail.com.

Jeffrey Yasskin

unread,
Apr 30, 2025, 11:17:19 AMApr 30
to Deepti Bogadi, blink-dev, Kenji Baheux, chrom...@google.com
The discussion in the API owners meeting raised the question of whether language detection has fewer fingerprinting risks than the other APIs covered by https://webmachinelearning.github.io/writing-assistance-apis/#privacy. Could you say something about that in https://webmachinelearning.github.io/translation-api/#privacy?

Thanks,
Jeffrey

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Deepti Bogadi

unread,
Apr 30, 2025, 6:56:54 PMApr 30
to Chris Harrelson, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com
Hi Chris,

Yes, the intent is to ship section 4 from the linked specification.

Regarding Mozilla, we have no signal from them.

Thanks,
Deepti

Chris Harrelson

unread,
Apr 30, 2025, 7:08:10 PMApr 30
to Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com


On Wed, Apr 30, 2025, 3:56 PM Deepti Bogadi <dbo...@chromium.org> wrote:
Hi Chris,

Yes, the intent is to ship section 4 from the linked specification.

Regarding Mozilla, we have no signal from them.

Have you reached out to discuss? I'm concerned there might be multiple incompatible translation apis under development.

Domenic Denicola

unread,
Apr 30, 2025, 11:29:03 PMApr 30
to Jeffrey Yasskin, Deepti Bogadi, blink-dev, Kenji Baheux, chrom...@google.com
On Thu, May 1, 2025 at 12:17 AM Jeffrey Yasskin <jyas...@chromium.org> wrote:
The discussion in the API owners meeting raised the question of whether language detection has fewer fingerprinting risks than the other APIs covered by https://webmachinelearning.github.io/writing-assistance-apis/#privacy. Could you say something about that in https://webmachinelearning.github.io/translation-api/#privacy?

Although it's true that in our specific implementation, language detector has fewer fingerprinting risks than others, that is not true in general. So we don't think it's necessarily a good idea to update the specification, beyond what is already called out as a possibility.

To be more concrete, in Chrome's implementation, we use a single language detection model that is downloaded on browser startup (since it is also used for parts of Chrome's UI). So the maximum number of fingerprinting bits is 1, and usually 0 since you can only distinguish between downloaded vs. un-downloaded shortly after new browser installations. In our implementation, the expectedInputLanguages constructor parameter does not influence the downloading behavior: it just causes creation to fail if the web developer includes an unsupported language in expectedInputLanguages.

Whereas, it's possible to imagine an implementation which has specialized detection models for each human language, and downloads the languages on demand in response to the expectedInputLanguages constructor option. Such a design could have 1 bit per possibly-supported language, and thus be subject to all of the myriad privacy considerations and mitigations discussed in the specification.

 
You received this message because you are subscribed to the Google Groups "chrome-chia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-chia...@google.com.
To view this discussion visit https://groups.google.com/a/google.com/d/msgid/chrome-chia/CANh-dXnvqTU0k7dEKRy%2BYBCvjzrDFYFPza_D7%3DVvEdCCR9W9jA%40mail.gmail.com.

Domenic Denicola

unread,
Apr 30, 2025, 11:39:30 PMApr 30
to Chris Harrelson, Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com
On Thu, May 1, 2025 at 8:08 AM Chris Harrelson <chri...@chromium.org> wrote:


On Wed, Apr 30, 2025, 3:56 PM Deepti Bogadi <dbo...@chromium.org> wrote:
Hi Chris,

Yes, the intent is to ship section 4 from the linked specification.

Regarding Mozilla, we have no signal from them.

Have you reached out to discuss? I'm concerned there might be multiple incompatible translation apis under development.

First, let's clarify that this is a discussion about translator APIs, whereas this Intent to Ship is for a language detector API. So although multiple translator APIs might be worrying for a translator I2S, I am hopeful it doesn't need to be treated as a blocker for language detector.

Anyway, we indeed have had ongoing discussions with Mozilla, both one-off and in the WebML Community Group, about this subject.

The status of their translator explainer is a bit unclear. As you can see, it hasn't been presented to any community group or working group. When we'd previously asked their WebML CG representatives about it, they said they were monitoring the space and weren't yet ready to present an alternative. They haven't given any negative signals on our proposed translator API (nor official positive ones).

It's also worth noting that the mozilla/explainers proposal is strictly less powerful than the WebML CG one that we're developing. That is, theirs can be polyfilled on top of ours, but not vice-versa. So if the mozilla/explainers proposal got traction in the future, we could add it as well, either natively or via a JavaScript polyfill.

It's also worth noting that some of the use cases that partners have used the translator API for during the origin trial are not possible with the mozilla/explainers proposal. Some examples:
  • Translating audio, in conjunction with web speech APIs for speech recognition and generation;
  • Translating user search terms, including translating them away from the user's preferred language. (E.g., prompting a Spanish-speaking user on an English e-commerce site with: "You entered 'zapatos'. Did you mean to search for 'shoes'?")

Hope this helps!

You received this message because you are subscribed to the Google Groups "chrome-chia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-chia...@google.com.
To view this discussion visit https://groups.google.com/a/google.com/d/msgid/chrome-chia/CAOMQ%2Bw9Aksov83aRn2UuTcFj_tJ%3D67JcTg28trmi_wtQeQ-S4g%40mail.gmail.com.

Chris Harrelson

unread,
May 2, 2025, 10:49:30 AMMay 2
to Domenic Denicola, Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com

Daniel Bratell

unread,
May 5, 2025, 5:11:51 AM (13 days ago) May 5
to Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com

Yoav Weiss (@Shopify)

unread,
May 5, 2025, 7:12:40 AM (13 days ago) May 5
to Daniel Bratell, Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com

Ashley Newson

unread,
May 15, 2025, 9:53:32 AM (3 days ago) May 15
to blink-dev, Yoav Weiss (@Shopify), Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, blink-dev, Kenji Baheux, chrom...@google.com, Daniel Bratell

Christine Hollingsworth

unread,
May 16, 2025, 11:31:39 AM (2 days ago) May 16
to Ashley Newson, blink-dev, Yoav Weiss (@Shopify), Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, Kenji Baheux, chrom...@google.com, Daniel Bratell
Hi Ashley, thank you for bringing this to our attention! This API should only be available on desktop only, and we're in the process of updating various resources / code ASAP to reflect that. 

Christian Biesinger

unread,
May 16, 2025, 11:40:07 AM (2 days ago) May 16
to Christine Hollingsworth, Ashley Newson, blink-dev, Yoav Weiss (@Shopify), Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, Kenji Baheux, chrom...@google.com, Daniel Bratell
I'm curious, what's the reason for making this desktop only?

Christian 

Christine Hollingsworth

unread,
May 16, 2025, 2:44:21 PM (2 days ago) May 16
to Christian Biesinger, Ashley Newson, blink-dev, Yoav Weiss (@Shopify), Chris Harrelson, Domenic Denicola, Deepti Bogadi, Alex Russell, Kenji Baheux, chrom...@google.com, Daniel Bratell
We'd like to fully support this API on Android, and it's going to take some additional implementation work to make that happen. As a result, we're prioritizing desktop support for this release.
Reply all
Reply to author
Forward
0 new messages