←back to thread

Web Translator API

(developer.mozilla.org)
97 points kozika | 1 comments | | HN request time: 0.268s | source
Show context
sfmz ◴[] No.44376080[source]
https://developer.chrome.com/docs/ai/translator-api

const translator = await Translator.create({ sourceLanguage: 'en', targetLanguage: 'fr', });

await translator.translate('Where is the next bus stop, please?');

replies(1): >>44378311 #
ks2048 ◴[] No.44378311[source]
So, this is Google Translate built running locally in Chrome? I wonder if it is a small/degraded model or limited languages? Otherwise, how is it not a simple way around the paid Google API?
replies(5): >>44378361 #>>44378552 #>>44379184 #>>44381572 #>>44381935 #
ameliaquining ◴[] No.44379184[source]
The article explains that this feature uses a small (up to 22 GB) language model that runs on-device.

That said, the "simple way around the paid API" problem is something Google has to deal with anyway, because there are a bunch of ways to use Google Translate without paying for it (e.g., the translate.google.com web UI, or the non-JavaScript-exposed "Translate to [language]" feature built into Chrome), and any action that can be taken by a human can in principle also be taken by a script. The only thing to do about it is use secret-sauce server-side abuse detection to block as much of this activity as they can; they can't get all of it but they can get enough to push enough people onto the paid API that the economics pencil out.

replies(1): >>44379749 #
jannes ◴[] No.44379749[source]
So installing Chrome is going to require 22 GB of disk space now?
replies(2): >>44379776 #>>44388237 #
1. dhx ◴[] No.44388237[source]
This sounds off by an order of magnitude? Firefox's local translation models are only 20-70MB per language pair direction (e.g. en-to-fr or fr-to-en).[1] These models are also only released when they reach at least -5% of Google Translate's COMET score.[1] Currently Firefox ships with support for 32 xx-to-en language pairs and 29 en-to-xx language pairs.[1] As the number of language pairs increases, it probably isn't unreasonable for browsers to stop bundling every language pair and instead prompt users to download uncommon models the first time the user wants to use them.

[1] https://mozilla.github.io/translations/firefox-models/