Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Extend Experiment: Language Detector API

90 views
Skip to first unread message

Nathan Memmott

unread,
Mar 10, 2025, 2:06:48 PMMar 10
to blin...@chromium.org

Contact emails

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


Explainer

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


Specification

https://webmachinelearning.github.io/translation-api/#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


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

kV8AILanguageDetector_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).


Our current implementation is tied up with the browser's built-in language detection, which runs on the main thread. Alternative architectures are possible and we're exploring the implications of the current one through the origin trial process.



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



Goals for experimentation



Reason this experiment is being extended

There has been an overhaul to the API shape in the spec that we're currently implementing. We'd like to continue the OT to get feedback on the new API shape once it's ready to evaluate.



Ongoing technical constraints

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?

No

We hope to work on web platform tests for this feature, but how much we can guarantee as testable beyond the surface API is unclear. For example, since no specific languages are guaranteed to be supported, it's not clear we can actually test language detection. APIs to mock the results might help here.



Flag name on about://flags

language-detection-api


Finch feature name

LanguageDetectionAPI


Requires code in //chrome?

False


Measurement

kV8LanguageDetector_Detect_Method


Estimated milestones

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



Link to entry on the Chrome Platform Status

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


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



This intent message was generated by Chrome Platform Status.


Mike Taylor

unread,
Mar 12, 2025, 6:42:35 PMMar 12
to Nathan Memmott, blink-dev

Could you also please comment on progress for the following areas:

Draft spec (early draft is ok, but must be spec-like and associated with the appropriate standardization venue, or WICG)
TAG review (see exceptions)
signals requests
Outreach for feedback from the spec community
WPT tests

On 3/10/25 2:06 PM, 'Nathan Memmott' via blink-dev wrote:

Reason this experiment is being extended

There has been an overhaul to the API shape in the spec that we're currently implementing. We'd like to continue the OT to get feedback on the new API shape once it's ready to evaluate.


--
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/CAO4d-SsFc3ucbmasgZmWn4PE_TOMMnWZQCzrL%3DXbbo5tDxMSOg%40mail.gmail.com.

Domenic Denicola

unread,
Mar 12, 2025, 10:41:35 PMMar 12
to Mike Taylor, Nathan Memmott, blink-dev
Hi Mike! I think we covered several of these areas in the original post, but thanks for the reminders on the rest.

On Thu, Mar 13, 2025 at 7:42 AM Mike Taylor <mike...@chromium.org> wrote:

Could you also please comment on progress for the following areas:

Draft spec (early draft is ok, but must be spec-like and associated with the appropriate standardization venue, or WICG)

As mentioned in the OP,  we now have a draft spec that's relatively detailed: https://webmachinelearning.github.io/translation-api/#language-detector-api .

TAG review (see exceptions)

As mentioned in the OP, TAG review was complete with issues addressed. 

signals requests

As mentioned in the OP,  we have open signals requests (with no responses yet)

Outreach for feedback from the spec community

This one we did not mention :). Since the original OT, we've moved to the Web ML Community Group and had several meetings with representatives there.

WPT tests

This one we probably should have given more detail on. Although as the OP mentions, testing is difficult here, we've started adding some tests (all marked as "tentative") in https://wpt.fyi/results/ai/language_detection?label=experimental&label=master&aligned .

On 3/10/25 2:06 PM, 'Nathan Memmott' via blink-dev wrote:

Reason this experiment is being extended

There has been an overhaul to the API shape in the spec that we're currently implementing. We'd like to continue the OT to get feedback on the new API shape once it's ready to evaluate.


--
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/CAO4d-SsFc3ucbmasgZmWn4PE_TOMMnWZQCzrL%3DXbbo5tDxMSOg%40mail.gmail.com.

--
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.

Mike Taylor

unread,
Mar 13, 2025, 8:43:37 AMMar 13
to Domenic Denicola, Nathan Memmott, blink-dev

Thanks for patiently re-highlighting what was (mostly) already in the intent. :)

LGTM to extend from 136 to 138 inclusive.

Reply all
Reply to author
Forward
0 new messages