News for hackers. Stuff that matters.
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Thursday June 02, 2022 @02:12PM (#31598511)
Hi, I am part of the team who developed this and the author of the article. You can ask me anything about it if you have questions.
Re:Mozilla releases local machine translation tools as part ... by coder543 on Thursday June 02, 2022 @02:31PM (#31598777)
Is this open source? I don't see a github link anywhere, and I'm not sure if the models are freely usable.

EDIT: maybe this is it: https://github.com/mozilla/firefox-translations-models

also some info here: https://github.com/mozilla/firefox-translations-training

Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:23AM (#31606045)
Yes, the extension is being developed here [1] and the engine[2]/wasm[3] wrapper here.

The models and training pipeline are in the urls your posted and the evaluation of those models are hosted here [4]

[1] https://github.com/mozilla/firefox-translations [2] https://github.com/browsermt/bergamot-translator [3] https://github.com/browsermt/bergamot-translator/tree/main/w... [4] https://github.com/mozilla/firefox-translations-models/tree/...

Re:Mozilla releases local machine translation tools as part ... by jelmervdl on Thursday June 02, 2022 @02:32PM (#31598797)
Re:Mozilla releases local machine translation tools as part ... by toastal on Friday June 03, 2022 @01:08AM (#31604512)
Did you mean link to the source code? GitHub shouldn't be equated with open source—especially considering the core product, GitHub, is closed source.
Re:Mozilla releases local machine translation tools as part ... by coder543 on Friday June 03, 2022 @01:18AM (#31604564)
Mozilla heavily uses GitHub to host repositories for basically all of their projects (with possibly just the exception of Firefox itself). Anyone familiar with Mozilla’s open source efforts knows they use GitHub heavily, so stating that I didn’t see the source on their preferred platform is perfectly reasonable.

Your comment is pedantic and unhelpful. It is effectively the same as overhearing someone asking another person for a Kleenex, then choosing to interject and lecture that person on the difference between Kleenex and tissue paper when the other person does have actual Kleenex-brand tissue. Yes, I know what open source is. Yes, Mozilla uses GitHub. I even provided links to relevant GitHub repositories by Mozilla once I found what I was looking for.

Re:Mozilla releases local machine translation tools as part ... by ainar-g on Thursday June 02, 2022 @02:31PM (#31598776)
Thanks for the extension!

Are you planning on adding a “select some text → right click → Translate in a tooltip” feature? It'd be extremely useful for language learners.

Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:25AM (#31606060)
Thanks to you for giving the extension a try! This is a very interesting feature, and I'd like to consider it. Would you mind filing an issue in the repo so we could track and discuss it here [1]?

[1] https://github.com/mozilla/firefox-translations/issues

Re:Mozilla releases local machine translation tools as part ... by ainar-g on Friday June 03, 2022 @05:56AM (#31606289)
Another user has posted a link to that issue: https://github.com/mozilla/firefox-translations/issues/358. I upvoted it instead of creating a new one.
Re:Mozilla releases local machine translation tools as part ... by HellsMaddy on Thursday June 02, 2022 @04:41PM (#31600243)
+1. This was the first thing I tried to do and was surprised this feature doesn't exist. Most often, I don't encounter entire webpages in foreign languages, but rather small snippets of text.

It seems there is an open issue for this: https://github.com/mozilla/firefox-translations/issues/358

Re:Mozilla releases local machine translation tools as part ... by 3np on Thursday June 02, 2022 @11:51PM (#31604079)
Hotkey + hover is very nice for words, fwiw.
Re:Mozilla releases local machine translation tools as part ... by mqus on Thursday June 02, 2022 @07:09PM (#31601745)
Can you please add the list of languages to the description of the addon[1]? For a translation addon this is crucial information imho.

[1] https://addons.mozilla.org/en-US/firefox/addon/firefox-trans...

Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:44AM (#31606202)
Just did it, thanks for the suggestion!
Re:Mozilla releases local machine translation tools as part ... by joveian on Thursday June 02, 2022 @11:54PM (#31604095)
Thanks, really wonderful project!

I tried it quick and a few comments:

It looks like both the web page version and browser extension download from storage.googleapis.com, which is not ideal (obviously much better than the text to be translated being sent). IMO, this should be clarified in the extension description. Are there any plans for Mozilla to host this data? (Well, Amazon I guess to match addons.mozilla.org)

https://mozilla.github.io/translate/

I noticed the web page has Polish but not the extension. Is it not considered sufficiently high quality yet? (Looks like that might be the case from a quick test.)

As with others, I first tried to translate a bit of text not the whole page. Another super helpful feature likely already on a todo list is the ability to see alternative translation options.

Thanks again, this is great and I'm surprised it isn't a larger download. I am curious about any size/quality tradeoffs being made.

Also, playing with the web page a bit English->Spanish I see it does a whole text translation such that adding new sentences affects the translation of earlier ones, sometimes in very odd ways (with one combination of words it translated "Spanish->English" to "español-esplén"). It seems to sometimes produce "Spanish" words that don't seem to be actual words in Spanish as best I can tell and even accoding to its own Spanish->English. It seems like a way to indicate a section to be translated as a unit might be helpful.

Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:37AM (#31606154)
> Are there any plans for Mozilla to host this data? (Well, Amazon I guess to match addons.mozilla.org)

I'll bring this internally for discussion.

> I noticed the web page has Polish but not the extension. Is it not considered sufficiently high quality yet? (Looks like that might be the case from a quick test.)

The Polish model finished training after we had the extension reviewed and signed for distribution, so that's why we could already integrate it in the website, which is controlled just by my team, and not in the extension yet, but we'll ship it in the next version which might come next week.

This feature you requested is something that I consider interesting and important, would you mind filing an issue in the repo so we could track it [1]?

We did not find any large quality issues after quantizing the models.

In regards to the neologism in Spanish, that is yes a condition that the consortium is aware and working to remediate it.

[1] https://github.com/mozilla/firefox-translations/issues

Re:Mozilla releases local machine translation tools as part ... by joveian on Friday June 03, 2022 @05:30PM (#31613899)
Thanks! Looks like I picked a bad test case for Polish, I tried a few more and some look perfect (boring corporate text) and others around the same as Google Translate (I don't know Polish or Spanish and mostly looked at song lyrics). I don't know if specific examples are helpful, but it looks like it particularly has a tough time with "W poprzek wpław" and I think a few more issues in:

https://www.musixmatch.com/lyrics/Teskno/Woda-t%C4%99skno-gr...

I'll add a few feature requests to the issue tracker (if not there already) hopefully later today. Including a request to put that web page in the extension :).

Re:Mozilla releases local machine translation tools as part ... by dnc on Thursday June 02, 2022 @02:26PM (#31598689)
Hi,

This is an awesome project, congratulations!

Could you share details about the machine translation engine that is used (or where to find out more about it)? Are there any plans to open source the extension code (with the WebAssembly optmizations that are mentioned in the article)?

Thanks.

Re:Mozilla releases local machine translation tools as part ... by jphilip on Thursday June 02, 2022 @03:01PM (#31599172)
A fork of marian-dev[1] is the underlying machine-translation engine:

- https://github.com/browsermt/marian-dev

Development of higher-level code wrapping around marian-dev make suitable for the browser-extension happens at:

- https://github.com/browsermt/bergamot-translator

Some of the WebAssembly optimizations are available in bergamot-translator/marian-dev. Rest are in Firefox source-code. A start point could be https://bugzilla.mozilla.org/show_bug.cgi?id=1720747.

Extension code is open-source, and linked already in other comments: - https://github.com/mozilla/firefox-translations

[1] https://github.com/marian-nmt/marian-dev

Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:49AM (#31606246)
You can find the engine used here [1], the API built around it here [2] and its WASM port here [3] and the WebAssembly matrix multiplication optimizations are here [4]

[1] https://marian-nmt.github.io/

[2] https://github.com/browsermt/bergamot-translator

[3] https://github.com/browsermt/bergamot-translator/tree/main/w...

[4] https://github.com/mozilla/gecko-dev/tree/master/third_party...

Re:Mozilla releases local machine translation tools as part ... by baobob on Thursday June 02, 2022 @02:53PM (#31599052)
At least the code parts seem to be on GitHub: https://github.com/browsermt
Re:Mozilla releases local machine translation tools as part ... by ashkhn on Thursday June 02, 2022 @03:17PM (#31599334)
Hi! This is an amazing project and will be really useful! Thank you! I understand that the project is funded by EU so the focus is on European languages but are there any plans to add CJK or other languages ?
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:52AM (#31606262)
Yes, that's something we've been discussing internally and is being considered. In this meantime, please feel free to file an issue in the repo [1] so we could track it:

[1] https://github.com/mozilla/firefox-translations/issues

Re:Mozilla releases local machine translation tools as part ... by msdrigg on Thursday June 02, 2022 @03:46PM (#31599672)
Chinese language is what I most commonly want to translate. Is there any planned support for this?
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:52AM (#31606264)
Yes, like I said above that's something we've been discussing internally and is being considered. In this meantime, please feel free to file an issue in the repo [1] so we could track it: [1] https://github.com/mozilla/firefox-translations/issues
Re:Mozilla releases local machine translation tools as part ... by Jourdelune on Tuesday June 07, 2022 @08:17AM (#31653073)
Hello, your tool is great! I have questions about the future of the project, is it planned to add languages in the future? The European Union grant ends in June and will the project continue to develop and add more languages in the future?
Re:Mozilla releases local machine translation tools as part ... by cf on Thursday June 02, 2022 @06:59PM (#31601652)
What can we do as users or contributers to help improve the accuracy of this extension? It's already amazing and would love to see it get even better.
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:58AM (#31606311)
Thanks for using it! Best way currently is to keep using and reporting issues on [1]. You can see how the models are trained on [2] and file issues there too.

[1] https://github.com/mozilla/firefox-translations/issues [2] https://github.com/mozilla/firefox-translations-training

Re:Mozilla releases local machine translation tools as part ... by unicornporn on Thursday June 02, 2022 @05:54PM (#31600990)
Google Translate code is present on many web sites to provide automatic translations of text. Could your translate code be uploaded to a server and embedded in web page to provide the same functionality?
Re:Mozilla releases local machine translation tools as part ... by jelmervdl on Thursday June 02, 2022 @06:25PM (#31601319)
I'm not aware of any actively maintained projects that give you this out of the box, but these two could be starting points for such a project.

Mozilla implemented a REST service based on (an earlier version of) bergamot-translator [1]. You could use that as a replacement for the WASM component in the addon's code.

I also know of some full-page translation demo code that uses the python bindings of bergamot-translator [2]. That's basically a web proxy a la Goole Translate.

Lastly, marian, the translation software that's being used, has a web server as well [3]. It does not support HTML though.

EDIT: see also my earlier comment for using it with Node or Python [4], which you could use to implement a simple web API.

[1] https://github.com/mozilla/translation-service

[2] https://github.com/jerinphilip/tagtransfer

[3] https://marian-nmt.github.io/docs/#web-server

[4] https://news.ycombinator.com/item?id=31599231

Re:Mozilla releases local machine translation tools as part ... by unicornporn on Friday June 03, 2022 @02:17PM (#31611828)
Thanks!
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:57AM (#31606298)
Sure, like I mentioned in the article, you can embed the engine and the models in any web page to be run in a browser with proper WebAssembly and SIMD support.

You can have an example on how we did here [1] and test it here (I recommend using Firefox) [2]

That way you don't need a server and everything is processed in the browser, so no need of google translate, or any cloud service to have translations embedded in any website anymore.

[1] https://github.com/mozilla/translate [2] https://mozilla.github.io/translate

Re:Mozilla releases local machine translation tools as part ... by maxloh on Thursday June 02, 2022 @04:23PM (#31600056)
What is the dataset used for training the model? Where did the data come from?
Re:Mozilla releases local machine translation tools as part ... by jelmervdl on Thursday June 02, 2022 @04:41PM (#31600242)
All of them are freely available. Most of them through mtdata [1]. The exact list of the datasets is in the firefox-translations-training pipeline configuration file [2].

[1] https://pypi.org/project/mtdata/

[2] https://github.com/mozilla/firefox-translations-training/blo...

Re:Mozilla releases local machine translation tools as part ... by jarrell_mark on Thursday June 02, 2022 @02:29PM (#31598754)
really great stuff! any plans for this on firefox mobile?
Re:Mozilla releases local machine translation tools as part ... by andrenatal1 on Friday June 03, 2022 @05:59AM (#31606316)
Yes, we are investigating how to support Firefox for Android.