3 ms·
https://developer.chrome.com/docs/ai/translator-api https://developer.chrome.com/docs/ai/translator-api const translator = await Translator.create({ sourceLa
by sfmz 1y ago
https://developer.chrome.com/docs/ai/translator-api 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?');
- ks2048 1y agoSo, 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?
- dbbk 1y agoCould it get more degraded?
- pinoy420 1y ago[dead]
- sfmz 1y agoThere's already ways to do translation locally in javascript with neural-nets running in WASM, this is just more convenient. https://huggingface.co/Xenova/nllb-200-distilled-600M https://huggingface.co/Xenova/nllb-200-distilled-600M
- vitonsky 1y agoI tried to use this model in my package with translators kit https://github.com/translate-tools/core/pull/112 https://github.com/translate-tools/core/pull/112 It runs very slow. Test case that run translation for text in 3k chars multiple times, takes about 30 seconds for google translator, but more than 10 minutes for `nllb-200-distilled-600M`. Text sample: https://github.com/translate-tools/core/pull/112/files#diff-7c638b74f3de8befc3cacd428f0d0732c10547172eca5afc8a9a037737b3e843 https://github.com/translate-tools/core/pull/112/files#diff-... My tests runs on nodejs, it looks in browser it have no chance for real world use
- ameliaquining 1y agoThe 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.
- jannes 1y agoSo installing Chrome is going to require 22 GB of disk space now?
- ks2048 1y agoIt only installs models that explicitly downloaded via this API, it seems. Also, it says to have 22 GB free, but below (under "Note"...), it says the model takes "around a couple of GB".
- cj 1y agoDoes the API trigger the download automatically, or does it ask for user permission? (Answered my own question): Doesn't look like it requires the user's permission. Upon first use, the model will start downloading. The user has to wait for the download to finish before the API will work. That could take hours for 22gb. I presume this can't work on mobile? https://developer.mozilla.org/en-US/docs/Web/API/Translator_and_Language_Detector_APIs/Using#monitoring_download_progress https://developer.mozilla.org/en-US/docs/Web/API/Translator_...
- ameliaquining 1y agoThe article indicates that it will only download the model over an unmetered connection, e.g., while the phone is connected to wifi.
- akazantsev 1y agoHere is the information on how it works in Chrome. https://developer.chrome.com/docs/ai/translator-api https://developer.chrome.com/docs/ai/translator-api