Name Translator
https://analytics.babelstreet.com/rest/v1/name-translation
https://raw.githubusercontent.com/rosette-api/curl-examples/develop/examples/name_translation.curl
Name translation transliterates the name of an entity (Person, Location, or Organization) between English and another language.
Important
Do not use the Analytics language identification endpoint to determine source language of names. Name translation uses an algorithm specifically tuned to identify the language of names rather than general text.
When you are converting from English to another language, the endpoint is optimized to convert the English version of a person’s name back to the native language of that name. For example, you can translate Vladimir Nabokov into Russian (rus
) and the endpoint returns "translation": "Владимир Набоков"
.
By default, name translator returns the best or most likely result. Use the parameter maximumResults
to return more results.
Request
We recommend that you include sourceLanguageOfUse
for optimal results, if you know the value. If you do not specify the language, then it is detected using an algorithm specific to names.
Examples:
For the name Mahmoud Abbas, the language of use is English, but the language of origin is Arabic since it is an Arabic name transliterated to English.
For ドナルド・トランプ the language of use is Japanese, but the language of origin is English since it is the name Donald Trump rendered in katakana.
For 上海 and 北京, they are Chinese names of Chinese cities, so the language of use and origin are the same.
Field | Type | Description | Value | Required |
---|---|---|---|---|
| string | Name to transliterate | yes | |
| string | Three-letter ISO 693-3 language code | yes | |
| string |
| PERSON (default), LOCATION, or ORGANIZATION | no |
| string | Script of the name as in the input | Four-letter ISO-15924 script code | no |
| string | Native language the name originates in | Three-letter ISO 693-3 language code | no (but strongly recommended if source language is known) |
| sting | Language of the name as in the input | Three-letter ISO 693-3 language code | no |
| string | Translate name into this script | Four-letter ISO-15924 script code | no |
| string | Scheme for transliteration | Transliteration scheme abbreviation | no (ADVANCED USE ONLY) |
| integer | Maximum number of translations to be returned. | If not provided, 1 value is returned. | no |
{ "name": "string", "targetLanguage": "string", "entityType": "PERSON", "sourceScript": "string", "sourceLanguageOfOrigin": "string", "sourceLanguageOfUse": "string", "targetScript": "string", "targetScheme": "string", "maximumResults": 0 }
Response
When maximumResults
is not specified, a single translation and confidence are returned.
{ "extendedInformation": { "processedByBabel": boolean }, "sourceScript": "string", "sourceLanguageOfUse": "string", "targetLanguage": "string", "targetScheme": "string", "targetScript": "string", "translation": "string", "confidence": 0.0 }
When maximumResults
is specified, a json object named translations
, containing both the translation and confidence field for each translation, is returned.
{ "extendedInformation": { "processedByBabel": boolean }, "sourceScript": "string", "sourceLanguageOfUse": "string", "targetLanguage": "string", "targetScheme": "string", "targetScript": "string", "translations": { "translation": "string", "confidence": 0.0 } ] }
processedByBabel
indicates whether the input value was processed in any way when performing the translation. For example, if an input of ABC
returns abc
, the value will be true
.
Supported languages
GET /name-translation/supported-languages
Retrieve the language pairs supported by the name-translation endpoint. The endpoint supports transliteration of the source language into the target language of each pair. The language, script, and transliteration scheme are listed for each source and target.
When translating from English, we recommend you use the endpoint to translate names of people to the name’s native language.
Response
Field | Type | Description |
---|---|---|
transliterationScheme | string | |
script | string | Four-letter ISO-15924 script code |
language | string | ISO 639 language code |
licensed | boolean | Indicates if you are licensed for this language |
{ "supportedLanguagePairs": [ { "source": { "transliterationScheme": "string", "script": "string". "language": "string" }, { "target": { "transliterationScheme": "string", "script": "string". "language": "string" }, "licensed": true } ] }