- Categories:
String & Binary Functions (Large Language Model)
TRANSLATE (SNOWFLAKE.CORTEX)¶
Fully qualified name: SNOWFLAKE.CORTEX.TRANSLATE
Translates the given input text from one supported language to another.
Note
This function does not transform a string given a search string and a replacement string. See the TRANSLATE function if that functionality is what you’re looking for.
Syntax¶
SNOWFLAKE.CORTEX.TRANSLATE(
<text>, <source_language>, <target_language>)
Arguments¶
text
A string containing the text to be translated.
source_language
A string specifying the language code for the language the text is currently in. See Usage Notes for a list of supported language codes. If the source language code is an empty string,
''
, the source language is automatically detected.target_language
A string specifying the language code into which the text should be translated. See Usage Notes for a list of supported language codes.
Returns¶
A string containing a translation of the original text into the target language.
Usage Notes¶
The following languages are supported by the TRANSLATE function. Use the corresponding language code for the source and target language.
Language |
Code |
---|---|
English |
|
French: |
|
German |
|
Italian |
|
Japanese |
|
Korean |
|
Polish |
|
Portuguese |
|
Russian |
|
Spanish |
|
Swedish |
|
Access Control¶
Users must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role. See Required Privileges for more information on granting this privilege.
Example¶
The following example translates each row of a table from English to German (in this example, review_content
is
a column from the reviews
table):
SELECT SNOWFLAKE.CORTEX.TRANSLATE(review_content, 'en', 'de') FROM reviews LIMIT 10;
Legal Notices¶
Snowflake Cortex LLM Functions are powered by machine learning technology, including Meta’s LLaMA 2 and Google’s Gemma 7B models.
The foundation LLaMA 2 model is licensed under the LLaMA 2 Community License and is Copyright (c) Meta Platforms, Inc. All Rights Reserved. Your use of any LLM Functions based on the LLama 2 model is subject to Meta’s Acceptable Use Policy.
The foundation Gemma 7B model is licensed under the Gemma Terms of Use, and use of it is subject to the Gemma Prohibited Use Policy.
Machine learning technology and results provided may be inaccurate, inappropriate, or biased. Decisions based on machine learning outputs, including those built into automatic pipelines, should have human oversight and review processes to ensure model-generated content is accurate.
LLM function queries are treated like any other SQL query and may be considered metadata.
For further information, see Snowflake AI Trust and Safety FAQ.