Search code examples
microsoft-translator

Can Microsoft Translator Service take context as a parameter for translation?


I am wondering if Microsoft Translator Service can take context as a parameter for translation. For example, I want to translate the word "run" as in "run a computer program", but not "run on a track".


Solution

    1. Translate with context
    2. Retrieve the translated phrase that aligns with the word in question: https://learn.microsoft.com/azure/cognitive-services/translator/word-alignment

    Be prepared for the operation to fail: There aren't always 1:1 translations of individual words. Works only from and to English.