Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1035014%22%20slang%3D%22en-US%22%3ECreate%20your%20own%20customized%20translation%20service%20with%20Microsoft%20Custom%20Translator%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1035014%22%20slang%3D%22en-US%22%3E%3CP%3EOrganizations%20and%20applications%20increasingly%20aim%20to%20cater%20to%20an%20international%20clientele.%20This%20often%20requires%20them%20to%20operate%20in%20various%20languages.%20For%20example%2C%20a%20multi-national%20corporation%20may%20have%20to%20translate%20internal%20documents%20for%20employees%20who%20live%20in%20different%20countries%20and%20speak%20diverse%20languages.%20The%20same%20company%20may%20also%20want%20to%20have%20their%20user%20manuals%20in%20various%20languages%2C%20as%20they%20sell%20their%20products%20in%20different%20countries.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Ftranslator%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Translator%3C%2FA%3E%20is%20a%20cognitive%20service%20that%20can%20be%20a%20good%20starting%20point%20in%20these%20circumstances.%20It%20can%20be%20used%20for%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPersonal%20us%3B%20to%20translate%20real-time%20conversations%2C%20menus%20and%20street%20signs%20while%20offline%2C%20websites%2C%20documents%2C%20and%20more%20using%20the%20Translator%20apps.%3C%2FLI%3E%0A%3CLI%3EBusiness%20operations%3B%20to%20help%20globalize%20your%20business%20and%20customer%20interactions.%3C%2FLI%3E%0A%3CLI%3EEducation%3B%20to%20create%20a%20more%20inclusive%20classroom%20for%20both%20students%20and%20parents%20with%20live%20captioning%20and%20cross-language%20understanding%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EMicrosoft%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Ftranslator%2Fcustom-translator%2Foverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECustom%20Translator%3C%2FA%3E%20feature%20of%20the%20Microsoft%20Translator%20API%20enables%20you%20to%20take%20it%20a%20step%20further%2C%20by%20allowing%20you%20to%20create%20a%20translation%20service%20that%20is%20customized%20to%20work%20on%20your%20own%20text%20data.%20It%20is%20currently%20limited%20to%20translating%20between%20English%20and%20around%2050%20supported%20languages%20(Custom%20Translator%20does%20currently%20not%20supported%20translation%20between%20two%20non-English%20languages).%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20say%20you%20are%20asked%20to%20create%20a%20translation%20service%20so%20that%20employees%20can%20share%20their%20work%20by%20translating%20documents%20back%20and%20forth%20between%20the%20different%20languages%20spoken%20at%20their%20organization.%20Unfortunately%2C%20these%20documents%20are%20full%20of%20idiosyncratic%20terminology%20that%20publicly%20available%20translation%20services%20cannot%20understand.%20Imagine%20having%20to%20translate%20the%20German%20word%20%E2%80%9CRindfleischetikettierungs%C3%BCberwachungsaufgaben%C3%BCbertragungsgesetz%E2%80%9D%2C%20which%20is%20the%20name%20of%20a%20law%20that%20regulates%20how%20responsibilities%20can%20be%20delegated%20among%20public%20employees%20who%20are%20in%20charge%20of%20ensuring%20that%20beef%20products%20are%20labeled%20correctly.%20This%20might%20be%20tough%20for%20a%20translation%20service%20that%20is%20not%20familiar%20with%20this%20subject%20or%20term.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMore%20seriously%20though%2C%20consider%20the%20following%20scenarios%20in%20which%20the%20Custom%20Translator%20feature%20might%20be%20helpful%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EUser%20manuals%20for%20airplanes%20contain%20concepts%20that%20are%20not%20used%20outside%20the%20aviation%20industry.%20A%20general-purpose%20translation%20service%20may%20erroneously%20translate%20these%20concepts%20as%20if%20they%20were%20part%20of%20common%20language.%20You%20don%E2%80%99t%20want%20to%20translate%20the%20%E2%80%9CMicrosoft%20Surface%20Go%E2%80%9D%20into%20German%20%E2%80%9CMicrosoft%20Oberfl%C3%A4che%20Gehen%E2%80%9D.%3C%2FLI%3E%0A%3CLI%3EA%20similar%20problem%20occurs%20when%20translating%20internal%20product%20or%20process%20documentation.%20Here%2C%20an%20additional%20requirement%20might%20be%20that%20these%20documents%20contain%20highly%20sensitive%20information%2C%20such%20as%20intellectual%20property.%20These%20documents%20can%20therefore%20not%20be%20published%2C%20which%20would%20be%20necessary%20for%20general%20purpose%20translation%20systems%20to%20have%20access%20to%20them%20for%20training.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20summary%2C%20the%20Custom%20Translator%20feature%20enables%20you%20to%20get%20better%20translations%20if%20you%20expect%20that%20translation%20requests%20will%20contain%20a%20lot%20of%20idiosyncratic%20terminology%20(e.g.%20industry%20specific%20vocabulary).%20The%20Custom%20Translator%20also%20enables%20you%20to%20perform%20secure%20translations.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1442175981%22%20id%3D%22toc-hId--1442175981%22%3EGetting%20Started%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECreating%20your%20first%20custom%20translation%20service%20for%20two%20languages%20is%20straightforward%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Ftranslator%2Fcustom-translator%2Fquickstart-build-deploy-custom-model%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EQuickstart%3C%2FA%3E%20is%20about%20a%202-minute%20read.%20You%20basically%20upload%20parallel%20documents%2C%20train%20the%20model%2C%20and%20deploy%20it.%20As%20the%20name%20implies%2C%20parallel%20documents%20are%20comprised%20of%20two%20parts%2C%20one%20for%20each%20language.%20For%20example%2C%20a%20parallel%20document%20could%20be%20a%20zip%20archive%20with%20two%20files%20in%20it%2C%20one%20containing%20the%20English%20versions%20and%20the%20other%20one%20the%20German%20versions%20of%20your%20user%20manuals.%20Ideally%2C%20the%20rows%20of%20the%20two%20documents%20are%20aligned%2C%20but%20some%20pre-processing%20is%20performed%20at%20the%20beginning%20of%20training%2C%20to%20ensure%20that%20rows%20are%20perfectly%20aligned.%20Do%20make%20sure%20that%20you%20have%20at%20least%2010K%20rows%20of%20data%20though%2C%20otherwise%20you%20probably%20won't%20have%20a%20rich%20enough%20vocabulary%20during%20training%20to%20achieve%20a%20reasonable%20customization.%20For%20this%20purpose%2C%20training%20will%20fail%20as%20stated%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Ftranslator%2Fcustom-translator%2Fsentence-alignment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESentence%20Alignment%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F159089i58A3C473C8A19665%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_3.png%22%20title%3D%22clipboard_image_3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFigure%201.%20Basic%20steps%20of%20creating%20a%20custom%20translation%20service.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1045336852%22%20id%3D%22toc-hId-1045336852%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--762117611%22%20id%3D%22toc-hId--762117611%22%3EBest%20Practices%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20devil%20is%20often%20hidden%20in%20the%20details%2C%20so%20let%E2%80%99s%20look%20at%20some%20best%20practices%20that%20might%20be%20helpful%20for%20your%20use-case.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--71556137%22%20id%3D%22toc-hId--71556137%22%3EProper%20usage%20of%20dictionaries%3C%2FH3%3E%0A%3CP%3EIn%20addition%20to%20parallel%20documents%2C%20the%20Custom%20Translator%20UI%20also%20allows%20the%20upload%20of%20bilingual%20dictionaries%2C%20containing%20entries%20defining%20the%20terminology%20used%20in%20your%20documents.%20Dictionaries%20can%20contain%20phrases%20or%20sentences%20for%20which%20you%20want%20to%20use%20an%20exact%20translation.%20When%20a%20translation%20request%20contains%20a%20phrase%20or%20sentence%20matches%20a%20source%20entry%20in%20the%20dictionary%2C%20the%20target%20phrase%20or%20sentence%20is%20returned%20in%20the%20translation%2C%20otherwise%2C%20best%20match%20from%20the%20model%20is%20returned.%20This%20can%20be%20especially%20useful%20for%20compound%20words%2C%20such%20as%20%E2%80%9CMicrosoft%20Surface%20Go%E2%80%9D%2C%20to%20ensure%20they%20are%20translated%20correctly%2C%20and%20that%20capitalization%20is%20exactly%20how%20you%20want%20it%20to%20be.%20For%20proper%20dictionary%20usages%20and%20best%20practices%2C%20please%20refer%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Ftranslator%2Fcustom-translator%2Fwhat-is-dictionary%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethe%20documentation%3F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20recommend%20that%20you%20use%20dictionaries%20only%20sparingly%2C%20because%20they%20have%20a%20downside%3A%20When%20a%20translation%20request%20for%20a%20sentence%20includes%20a%20word%20from%20the%20dictionary%2C%20a%20placeholder%20is%20inserted%20for%20that%20word%20before%20translating%20the%20remaining%20sentence.%20The%20translation%20model%20will%20then%20lack%20this%20word%20as%20context%20when%20translating%20the%20rest%20of%20the%20sentence.%20Imagine%20trying%20to%20translate%20a%20sentence%20yourself%20when%20critical%20words%20are%20missing%3A%20You%E2%80%99re%20not%20going%20to%20do%20so%20well.%20The%20model%20will%20have%20the%20same%20problem.%3C%2FP%3E%0A%3CP%3EOne%20alternative%20use%20for%20dictionaries%20is%20to%20upload%20them%20as%20additional%20parallel%20documents%20for%20training%2C%20rather%20than%20as%20dictionaries.%20This%20way%20the%20model%20will%20just%20learn%20to%20use%20the%20dictionary%20entries%2C%20and%20words%20from%20the%20dictionary%20will%20be%20available%20as%20context%20when%20translating%20the%20rest%20of%20the%20sentence.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1879010600%22%20id%3D%22toc-hId--1879010600%22%3EGetting%20parallel%20documents%20in%20line%20with%20terminology%3C%2FH3%3E%0A%3CP%3EOne%20final%20suggestion%20on%20how%20to%20get%20translation%20in%20line%20with%20the%20desired%20terminology%3A%20I%20have%20had%20the%20issue%20before%20where%20I%20included%20a%20dictionary%20as%20parallel%20document%20for%20training%2C%20but%20my%20tests%20revealed%20that%20the%20deployed%20model%20wasn%E2%80%99t%20using%20the%20terminology%20reliably%20after%20all.%20What%20happened%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20realized%20that%20some%20of%20the%20parallel%20documents%20I%20used%20for%20training%20were%20kind%20of%20old%2C%20containing%20deprecated%20terminology.%20That%20must%20have%20been%20really%20confusing%20for%20the%20model.%20There%20are%20two%20options%20for%20dealing%20with%20this.%20The%20simple%20solution%20is%20to%20remove%20sentences%20from%20the%20parallel%20documents%20that%20are%20inconsistent%20with%20the%20terminology.%20Another%2C%20more%20complicated%20solution%2C%20is%20to%20correct%20those%20sentences%20in%20the%20parallel%20documents%2C%20to%20ensure%20that%20they%20are%20consistent%20with%20the%20terminology.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20reading%2C%20I%20hope%20these%20suggestions%20will%20be%20helpful%20when%20you%20try%20to%20build%20a%20custom%20translator%20solution.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1035014%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20blog%20post%2C%20I%20suggest%20a%20couple%20of%20best-practices%20that%20may%20be%20helpful%20when%20you%20want%20to%20create%20a%20custom%20translation%20service%2C%20which%20will%20be%20able%20to%20take%20potentially%20private%20or%20sensitive%20terminology%20into%20account%20during%20translation.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1035014%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECognitive%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENational%20Language%20Processing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeural%20Machine%20Translation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENLP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENMT%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Organizations and applications increasingly aim to cater to an international clientele. This often requires them to operate in various languages. For example, a multi-national corporation may have to translate internal documents for employees who live in different countries and speak diverse languages. The same company may also want to have their user manuals in various languages, as they sell their products in different countries.

 

Microsoft Translator is a cognitive service that can be a good starting point in these circumstances. It can be used for:

  • Personal us; to translate real-time conversations, menus and street signs while offline, websites, documents, and more using the Translator apps.
  • Business operations; to help globalize your business and customer interactions.
  • Education; to create a more inclusive classroom for both students and parents with live captioning and cross-language understanding

Microsoft Custom Translator feature of the Microsoft Translator API enables you to take it a step further, by allowing you to create a translation service that is customized to work on your own text data. It is currently limited to translating between English and around 50 supported languages (Custom Translator does currently not supported translation between two non-English languages).

Let’s say you are asked to create a translation service so that employees can share their work by translating documents back and forth between the different languages spoken at their organization. Unfortunately, these documents are full of idiosyncratic terminology that publicly available translation services cannot understand. Imagine having to translate the German word “Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz”, which is the name of a law that regulates how responsibilities can be delegated among public employees who are in charge of ensuring that beef products are labeled correctly. This might be tough for a translation service that is not familiar with this subject or term.

 

More seriously though, consider the following scenarios in which the Custom Translator feature might be helpful:

  • User manuals for airplanes contain concepts that are not used outside the aviation industry. A general-purpose translation service may erroneously translate these concepts as if they were part of common language. You don’t want to translate the “Microsoft Surface Go” into German “Microsoft Oberfläche Gehen”.
  • A similar problem occurs when translating internal product or process documentation. Here, an additional requirement might be that these documents contain highly sensitive information, such as intellectual property. These documents can therefore not be published, which would be necessary for general purpose translation systems to have access to them for training.

 

In summary, the Custom Translator feature enables you to get better translations if you expect that translation requests will contain a lot of idiosyncratic terminology (e.g. industry specific vocabulary). The Custom Translator also enables you to perform secure translations.

 

Getting Started

 

Creating your first custom translation service for two languages is straightforward, the Quickstart is about a 2-minute read. You basically upload parallel documents, train the model, and deploy it. As the name implies, parallel documents are comprised of two parts, one for each language. For example, a parallel document could be a zip archive with two files in it, one containing the English versions and the other one the German versions of your user manuals. Ideally, the rows of the two documents are aligned, but some pre-processing is performed at the beginning of training, to ensure that rows are perfectly aligned. Do make sure that you have at least 10K rows of data though, otherwise you probably won't have a rich enough vocabulary during training to achieve a reasonable customization. For this purpose, training will fail as stated in Sentence Alignment.

clipboard_image_3.png

Figure 1. Basic steps of creating a custom translation service.

 

Best Practices

 

The devil is often hidden in the details, so let’s look at some best practices that might be helpful for your use-case.

 

Proper usage of dictionaries

In addition to parallel documents, the Custom Translator UI also allows the upload of bilingual dictionaries, containing entries defining the terminology used in your documents. Dictionaries can contain phrases or sentences for which you want to use an exact translation. When a translation request contains a phrase or sentence matches a source entry in the dictionary, the target phrase or sentence is returned in the translation, otherwise, best match from the model is returned. This can be especially useful for compound words, such as “Microsoft Surface Go”, to ensure they are translated correctly, and that capitalization is exactly how you want it to be. For proper dictionary usages and best practices, please refer to the documentation?

 

I recommend that you use dictionaries only sparingly, because they have a downside: When a translation request for a sentence includes a word from the dictionary, a placeholder is inserted for that word before translating the remaining sentence. The translation model will then lack this word as context when translating the rest of the sentence. Imagine trying to translate a sentence yourself when critical words are missing: You’re not going to do so well. The model will have the same problem.

One alternative use for dictionaries is to upload them as additional parallel documents for training, rather than as dictionaries. This way the model will just learn to use the dictionary entries, and words from the dictionary will be available as context when translating the rest of the sentence.

 

Getting parallel documents in line with terminology

One final suggestion on how to get translation in line with the desired terminology: I have had the issue before where I included a dictionary as parallel document for training, but my tests revealed that the deployed model wasn’t using the terminology reliably after all. What happened?

 

I realized that some of the parallel documents I used for training were kind of old, containing deprecated terminology. That must have been really confusing for the model. There are two options for dealing with this. The simple solution is to remove sentences from the parallel documents that are inconsistent with the terminology. Another, more complicated solution, is to correct those sentences in the parallel documents, to ensure that they are consistent with the terminology.

 

Thanks for reading, I hope these suggestions will be helpful when you try to build a custom translator solution.