Return N-Best Translations
Motivation
Generating artificial alternatives in translation, fully integrated with the collaborative translations framework (CTF). Return alternatives for sentences that have no alternatives in CTF, by adding artificial alternatives from the n-best list of the decoder.
Public API
The GetTranslations() and GetTranslationsArray() methods in the V2 API of Microsoft Translator include an optional Boolean flag "IncludeMultipleMTAlternatives".
The signature remains unchanged from the SDK. The method will return up to maxTranslations alternatives, even if there are not as many CTF entries available, where the delta is supplied from the n-best list of the translator engine.
The signature is:
| C# |
|---|
GetTranslationsResponse Microsoft.Translator.GetTranslations(appId, text, from, to, maxTranslations, options); |
| Parameter | Description |
|---|---|
|
appId |
Required. If the Authorization header is used, leave the appid field empty else specify a string containing "Bearer" + " " + access token. |
|
text |
Required. A string representing the text to translate. The size of the text must not exceed 10000 characters. |
|
from |
Required. A string representing the language code of the text to translate. |
|
to |
Required. A string representing the language code to translate the text into. |
|
maxTranslations |
Required. An int representing the maximum number of translations to return. |
|
options |
Optional. A TranslateOptions object that contains the values listed below. They are all optional and default to the most common settings.
|
Ratings
The ratings are applied as follows:
- The best automatic translation has a rating of 5.
- The alternatives from CTF reflect the authority of the reviewer, from -10 to +10.
- The automatically generated (n-best) translation alternatives have a rating of 0, and have a match degree of 100.
Number of Alternatives
The number of returned alternatives is up to maxTranslations, but may be less.
Language pairs
This functionality is not available for translations between Simplified and Traditional Chinese, both directions. It is available for all other Microsoft Translator supported language pairs.