SENTIMENT

functiondeferredAI & ML

docs.snowflake.com ↗

String & binary functions

Returns an overall sentiment score for the given English-language input text.

Syntax

SNOWFLAKE.CORTEX.SENTIMENT(<text>)

Parameters

NameRequiredDescription
textrequiredA string containing the text for which a sentiment score should be calculated.

Returns

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: The result does not indicate the intensity of sentiment, but the polarity (positive, neutral, or negative) and certainty.

Access control requirements

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.

Legal notices

Refer to Snowflake AI and ML.

Known gaps

Parts not fully supported, and recorded divergences from Snowflake.