AutoML Translation – It’s Never been Easier
We all know (and mostly love!) Google Translate. It gives us instantaneous access to content in any language whatsoever. Now it is getting even better: with AutoML Translation. This post gives a first overview of how this new and exciting tool works.
The Standard Translate Feature
If used judiciously – that is, if taken with a grain of salt and not mistaken for a 100% perfect translation – Google’s standard translate feature is a most powerful enabler for businesses all around the globe. Many individuals and international organisations rely on machine translation to quickly access the basics of reports, emails, inquiries, tenders and regulations in dozens of languages.
While results are generally very useful for a wide range of topics and texts, we also see the recurring need to improve translations in certain specific areas, integrate some very sophisticated technical terminology or integrate a company’s internal taxonomy, special expressions and entities.
With AutoML TranslationBeta Google now offers its customer the opportunity to build their own translation machine that is targeted very specifically to their needs.
How AutoML Translation Works
Google’s AutoML offering for translation is based – like its other AutoML models for vision and natural language processing – on the concept of transfer learning. Transfer learning, in a nutshell, is the discipline of “recycling” machine learning models. In this case, it is Google’s NMT model (Neural Network for Machine Translation) which is recycled. This model, trained over weeks and on trillions of documents in 10,000 language pairs, is taken as the basis for our custom translation models with AutoML.
The image shows a schematic and strongly simplified version of the model built by Google. Each arrow stands for an individual weight factor (a decimal number) that has been carefully fine-tuned in a long training process. In the training process millions of sentence pairs in the source language and the target language have been presented repeatedly to the system. At each step the system has taken the source sentence, encoded it in numbers, then applied all the weights and multiplications, and in the end decoded these numbers back to letters and a full sentence. Now, if that computed sentence corresponded to the “correct” (= previously known) target sentence – “Bingo!”
If, very much more likely, the output was not quite the expected translation, however, the system makes tiny adjustments to the weights, so that when next time it encounters the same input sentence, it will be more likely to produce the correct output. And so on, for millions of cycles until an equilibrium is reached where for (almost) all the examples, the computed output corresponds to the expected output.
AutoML now works as follows: It starts with Google’s fully trained base model (including all the carefully elaborated weights) and simply resumes and continues the training process with new, additional sentence pairs that you have provided. Thus, the model is very slightly altered, “unlearning” in some areas its previous translations and instead learning the new translations from the examples you give it. Of course, in order to keep the side-effects on “neutral” parts of the system minimal, such adjustments must be done very carefully and in the tiniest of steps.
The Good News
If the explanation above was too technical, mathematical, complicated, superficial, or for other reasons putting you off, there is some good news: you do not need to worry about any of this. The interface for using AutoML is dead easy to use. All you need is a tabulator-separated file with translated sentence pairs that you want the system to learn (TMX files also work). Then, setting up your own custom translation machine is a matter of a few clicks:
- Go to the AutoML Translation website (https://beta-dot-custom-vision.appspot.com/).
- Create a new Dataset by giving it a name and defining the source and target languages.
- Upload the tab-separated file(s) with the custom translations that you want the system to learn.
- Click “Train” and start the training process.
That’s it! The most difficult part is now to be patient…
Training a custom model even with a minimum of some 30 extra translations takes 1.5 hours. Typically, and with larger sets, re-training takes about 3 hours. Remember: the adjustment steps must be tiny and the system must make sure it does not unlearn too much!
Testing the New Model
You will receive an email notification after your model is trained. Testing your new model with a few samples could not be easier: On the “Predict” screen, just enter a sample sentence and see how it will be translated, both by the standard base GNMT model and your customized new model.
The model shown in the screenshot has been trained with a 137 extra sentence pairs to improve its capability of translating chess terms accurately from English to German. While the advice in the example itself may not be very sound in the first place, the new translation is definitely more to the point than the original one (which for mysterious reasons produces some wisdom from zoology – which is, moreover, even less sound than the source sentence!).
Our experiments have shown that even with just a few sample sentences, the system can learn new terminology reliably. Ideally, you will have for each word a few sample sentences with different grammatical usages.
As always with machine learning: the higher the quality of your data, the better the results.
Integration and Cost
Integration in other systems with AutoML is as easy as with the ordinary Translate API from Google.
The cost for training the model is currently $76 per hour, so in the range of $150 to $225 for a new model. Unless your budget is unlimited, it thus pays to keep the number of experiments small and invest more time in planning and preparing good datasets.
Once trained, hosting the customized model does not trigger any extra costs. Instead, you pay per translation. The price is considerably higher than for the standard translate API, but at $80 per 1,000,000 characters still very reasonable.
AutoML Translate, currently in Beta, is extremely easy to use. It has great potential for improving the day-to-day translations in your domain and it is certain to catch on fast with (enterprise) users.
Best practices for how to feed it will have to be established, but it is certain that machine learning for translation services has never been so easy.
If you want to learn how to leverage this exciting new possibility, do not hesitate to reach out to us!