TRANSLATE
The TRANSLATE
commands lets you translate text from a number of different languages to English.
The command will append one columns to the output, prediction
, which is the translated text in English.
Our translation models are Huggingface models, and in particular those by the OPUS-MT team at the University of Helsinki.
Available languages and their keys are below:
"ar": "Arabic",
"bg": "Bulgarian",
"ca": "Catalan",
"swc": "Congo Swahili",
"cs": "Czech",
"da": "Danish",
"nl": "Dutch",
"et": "Estonian",
"fi": "Finnish",
"fr": "French",
"de": "German",
"hi": "Hindi",
"hu": "Hungarian",
"id": "Indonesian",
"it": "Italian",
"ja": "Japanese",
"ko": "Korean",
"romance": "Multilingual model for Romance languages",
"pl": "Polish",
"ru": "Russian",
"es": "Spanish",
"sv": "Swedish",
"th": "Thai",
"tr": "Turkish",
"uk": "Ukranian",
"ur": "Urdu",
"vi": "Vietnamese",
Syntax
TRANSLATE(<column_name>, [, source_language=<source_language>])
column_name
the input column name to run translation on. This must be a text column.source_language
is the language that we are translating from, e.g. French-to-English would besource_language=fr
.- The default is
romance
, a multilingual translation model for Romance languages.
- The default is
Returns
The command will append one column to the output, prediction
, which is the translated text in English.
Examples
Translates the text in the column Review Text
.
SELECT * FROM reviews TRANSLATE("Review Text")