Mozilla has announced the launch of Firefox Translationsan offline machine translation tool for the Firefox web browser.
“To empower the community to contribute with new languages, we also developed a comprehensive training pipeline to allow enthusiasts to easily train new models, helping expand the add-on reach,” said machine learning engineering leader Andre Natal.
Firefox’s offline translation project began in January 2019 through a partnership with the University of Edinburgh, Charles University, University of Sheffield, and University of Tartu.
Funded by the European Union, it was called Project Bergamot.
“The ultimate goal of this consortium was to build a set of neural machine translation tools that would enable Mozilla to develop a website translation add-on that operates locally,” Natal explained.
“The engines, language models and in-page translation algorithms would need to reside and be executed entirely in the user’s computer, so none of the data would be sent to the cloud, making it entirely private.”
Natal said that two novel features also needed to be introduced.
The first was form translation, allowing users to input text in their language and translate it on-the-fly to the page’s language.
The second feature was translation quality estimation, where low confidence translations should be highlighted on the page, notifying the user of potential errors.
This presented a technical challenge as the translation engine was written in programming languages that compile to native code, and don’t run in a web browser.
“Our solution to that was to develop a high-level API around the machine translation engine, port it to WebAssembly, and optimise the operations for matrix multiplication to run efficiently on CPUs,” Natal said.
“That enabled us to not only develop the translations add-on but also allowed every web page to integrate local machine translation, like in this website, which lets the user perform free-form translations without using the cloud.”
Firefox Translate supported Spanish, Bulgarian, Czech, English, Estonian, German, Icelandic, Italian, Norwegian Bokmal and Nynorsk, Persian, Portuguese, and Russian at launch.
“We are looking for users’ feedback,” Natal said.
“In the add-on, you’ll see a button to fill out a survey that will help Project Bergamot collaborators understand which direction we should take the product.”