- Categories:
String & Binary Functions (Large Language Model)
SENTIMENT (SNOWFLAKE.CORTEX)¶
Returns a sentiment score for the given English-language input text.
Syntax¶
SNOWFLAKE.CORTEX.SENTIMENT(<text>)
Arguments¶
text
A string containing the text for which a sentiment score should be calculated.
Returns¶
A floating-point number from -1 to 1 (inclusive) indicating the level of negative or positive sentiment in the text. Values around 0 indicate neutral sentiment.
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¶
In this example, a table named reviews
contains a column named review_content
containing the text of reviews
submitted by users. The query returns a sentiment score for each review.
SELECT SNOWFLAKE.CORTEX.SENTIMENT(review_content), review_content 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.