- 카테고리:
문자열 및 이진 함수 (AI 함수)
SENTIMENT (SNOWFLAKE.CORTEX)¶
주어진 영어 입력 텍스트에 대한 전체 감정 점수를 반환합니다.
구문¶
SNOWFLAKE.CORTEX.SENTIMENT(<text>) 인자¶
text감정 점수를 계산해야 하는 텍스트가 포함된 문자열입니다.
반환¶
A floating-point number from -1 to 1 (inclusive) indicating the model’s level of certainty of any detected sentiment. A score close to 0 indicates that the function could not determine a clear sentiment in the text; this result can be considered neutral. A score close to 1 indicates positive sentiment, while a score close to -1 indicates negative sentiment. The chart below provides guidance on how to interpret the sentiment scores:
감성 | 감정 점수 |
|---|---|
긍정적 | 0.5~1 |
중립 | -0.5~0.5 |
부정적 | -0.5~-1 |
결과는 감정의 강도를 나타내는 것이 아니라 극성(긍정, 중립 또는 부정)과 확실성을 나타냅니다.
액세스 제어 요구 사항¶
Users must use a role that has been granted the SNOWFLAKE.CORTEX_USER database role. See Cortex LLM privileges for more information on this privilege.
예¶
다음 예제에서는 SENTIMENT를 사용하여 외식 서비스 리뷰의 감정 분류를 구합니다. 이 감정 분류는 점수가 0.54인 것을 감안할 때 다소 긍정적인 것으로 추론할 수 있습니다.
SELECT SNOWFLAKE.CORTEX.SENTIMENT('A tourist\'s delight, in low urban light, Recommended gem, a pizza night sight. Swift arrival, a pleasure so right, Yet, pockets felt lighter, a slight pricey bite. 💰🍕🚀'); 응답:
0.5424458 다음 예제에서는 이름이 reviews 인 테이블에 사용자가 제출한 리뷰 텍스트가 포함된 review_content 라는 열이 포함되어 있습니다. 이 쿼리는 각 리뷰에 대한 감정 점수를 반환합니다.
SELECT SNOWFLAKE.CORTEX.SENTIMENT(review_content), review_content FROM reviews LIMIT 10; 법적 고지¶
Snowflake AI 및 ML 섹션을 참조하십시오.
제한 사항¶
Snowflake Cortex 함수는 동적 테이블을 지원하지 않습니다.