카테고리:

문자열 및 이진 함수 (대규모 언어 모델)

TRANSLATE (SNOWFLAKE.CORTEX)

지정된 입력 텍스트를 지원되는 언어 간에 번역합니다.

주의

이 함수는 검색 문자열과 대체 문자열이 주어지면 문자열을 변환하지 않습니다. 해당 기능이 필요한 경우 TRANSLATE 함수를 참조하십시오.

구문

SNOWFLAKE.CORTEX.TRANSLATE(
    <text>, <source_language>, <target_language>)
Copy

인자

text

번역할 텍스트가 포함된 문자열입니다.

source_language

현재 텍스트 작성에 사용된 언어의 언어 코드를 지정하는 문자열입니다. 지원되는 언어 코드 목록은 사용법 노트 를 참조하십시오. 원본 언어 코드가 빈 문자열('')이면 원본 언어가 자동으로 감지됩니다.

target_language

텍스트를 번역해야 하는 대상 언어 코드를 지정하는 문자열입니다. 지원되는 언어 코드 목록은 사용법 노트 를 참조하십시오.

반환

원본 텍스트를 대상 언어로 번역한 내용이 포함된 문자열.

사용법 노트

TRANSLATE 함수는 다음 언어를 지원합니다. 원본 및 대상 언어에 해당하는 언어 코드를 사용하십시오.

TRANSLATE 모델은 변환되는 텍스트에 서로 다른 두 가지 언어(예: “스페인어”)를 혼합하는 것도 지원합니다. 이 경우 빈 문자열('')을 소스 언어로 지정하면 소스 텍스트에 사용된 언어가 자동으로 감지됩니다.

언어

코드

중국어

'zh'

네덜란드어

'nl'

영어

'en'

프랑스어:

'fr'

독일어

'de'

힌디어

'hi'

이탈리아어

'it'

일본어

'ja'

한국어

'ko'

폴란드어

'pl'

포르투갈어

'pt'

러시아어

'ru'

스페인어

'es'

스웨덴어

'sv'

TRANSLATE 함수는 소스 또는 대상 언어가 영어일 때 최상의 결과를 생성합니다(예: 영어에서 스페인어로 또는 독일어에서 영어로). 독일어와 스페인어 등 다른 언어 쌍에 대한 결과는 정확도가 떨어질 수 있습니다.

액세스 제어 요구 사항

사용자는 SNOWFLAKE.CORTEX_USER 데이터베이스 역할 이 부여된 역할을 사용해야 합니다. 이 권한에 대한 자세한 내용은 필수 권한 섹션을 참조하십시오.

다음 예에서는 테이블의 각 행을 영어에서 독일어로 번역합니다(이 예에서 review_contentreviews 테이블의 열임).

SELECT SNOWFLAKE.CORTEX.TRANSLATE(review_content, 'en', 'de') FROM reviews LIMIT 10;
Copy

다음 예제는 가상의 제품 리뷰를 영어에서 스페인어로 변환하는 예제입니다.

SELECT SNOWFLAKE.CORTEX.TRANSLATE(
  'Hit the slopes with Snowflake\'s latest innovation - "Skii Headphones" designed to keep your ears warm and your soul ablaze. Engineered specifically for snow weather, these rugged headphones combine crystal-clear sound with thermally-insulated ear cups to keep the chill out and the beats in. Whether you\'re carving through powder or cruising down groomers, Skii Headphones will fuel your mountain adventures with vibrant sound and unrelenting passion. Stay warm, stay fired up, and shred the mountain with Snowflake Skii Headphones',
'en','es');
Copy

이 쿼리 결과는 다음과 같습니다.

Sube a las pistas con la última innovación de Snowflake: "Skii Headphones", diseñados para mantener tus oídos calientes y tu alma encendida. Diseñados específicamente para el clima de nieve, estos audífonos resistentes combinan un sonido cristalino con copas de oído aisladas térmicamente para mantener el frío fuera y los ritmos dentro. Ya sea que estés esculpiendo en polvo o deslizándote por pistas preparadas, los Skii Headphones alimentarán tus aventuras en la montaña con un sonido vibrante y una pasión incesante. Mantente caliente, mantente encendido y arrasa la montaña con los Skii Headphones de Snowflake.

다음 예제는 독일어에서 영어로 호출 내용을 변환하는 예제입니다.

SELECT SNOWFLAKE.CORTEX.TRANSLATE
  ('Kunde: Hallo
    Agent: Hallo, ich hoffe, es geht Ihnen gut. Um Ihnen am besten helfen zu können, teilen Sie bitte Ihren Vor- und Nachnamen und den Namen der Firma, von der aus Sie anrufen.
    Kunde: Ja, hier ist Thomas Müller von SkiPisteExpress.
    Agent: Danke Thomas, womit kann ich Ihnen heute helfen?
    Kunde: Also wir haben die XtremeX Helme in Größe M bestellt, die wir speziell für die kommende Wintersaison benötigen. Jedoch sind alle Schnallen der Helme defekt, und keiner schließt richtig.
    Agent: Ich verstehe, dass das ein Problem für Ihr Geschäft sein kann. Lassen Sie mich überprüfen, was mit Ihrer Bestellung passiert ist. Um zu bestätigen: Ihre Bestellung endet mit der Nummer 56682?
    Kunde: Ja, das ist meine Bestellung.
    Agent: Ich sehe das Problem. Entschuldigen Sie die Unannehmlichkeiten. Ich werde sofort eine neue Lieferung mit reparierten Schnallen für Sie vorbereiten, die in drei Tagen bei Ihnen eintreffen sollte. Ist das in Ordnung für Sie?
    Kunde: Drei Tage sind ziemlich lang, ich hatte gehofft, diese Helme früher zu erhalten. Gibt es irgendeine Möglichkeit, die Lieferung zu beschleunigen?
    Agent: Ich verstehe Ihre Dringlichkeit. Ich werde mein Bestes tun, um die Lieferung auf zwei Tage zu beschleunigen. Wie kommst du damit zurecht?
    Kunde: Das wäre großartig, ich wäre Ihnen sehr dankbar.
    Agent: Kein Problem, Thomas. Ich kümmere mich um die eilige Lieferung. Danke für Ihr Verständnis und Ihre Geduld.
    Kunde: Vielen Dank für Ihre Hilfe. Auf Wiedersehen!
    Agent: Bitte, gerne geschehen. Auf Wiedersehen und einen schönen Tag noch!'
,'de','en');
Copy

결과는 다음과 같습니다.

Customer: Hello
Agent: Hello, I hope you are well. To best assist you, please share your first and last name and the name of the company you are calling from.
Customer: Yes, this is Thomas Müller from SkiPisteExpress.
Agent: Thank you, Thomas, what can I help you with today?
Customer: So, we ordered the XtremeX helmets in size M, which we specifically need for the upcoming winter season. However, all the buckles on the helmets are defective and none of them close properly.
Agent: I understand that this can be a problem for your business. Let me check what happened with your order. To confirm: your order ends with the number 56682?
Customer: Yes, that's my order.
Agent: I see the issue. I apologize for the inconvenience. I will prepare a new delivery with repaired buckles for you immediately, which should arrive in three days. Is that okay for you?
Customer: Three days is quite a long time; I was hoping to receive these helmets sooner. Is there any way to expedite the delivery?
Agent: I understand your urgency. I will do my best to expedite the delivery to two days. How does that sound?
Customer: That would be great, I would be very grateful.
Agent: No problem, Thomas. I will take care of the urgent delivery. Thank you for your understanding and patience.
Customer: Thank you very much for your help. Goodbye!
Agent: You're welcome. Goodbye and have a nice day!

마지막으로 다음 예제는 서로 다른 두 언어(이 경우 영어와 스페인어, 또는 “스페인어”로 표기)의 텍스트를 영어로 변환하는 예제입니다. 소스 언어의 사양은 빈 문자열이라는 점에 유의하십시오.

SELECT SNOWFLAKE.CORTEX.TRANSLATE ('Voy a likear tus fotos en Insta.', '', 'en')
Copy

이 쿼리 결과는 다음과 같습니다.

I'm going to like your photos on Insta.