Sentiment analysis classifies customer reviews as negative, neutral, or positive by converting text into a sentiment score and then applying SQL thresholds. In a Snowflake review pipeline, Snowflake Cortex SENTIMENT augments stored customer reviews so employees can focus on selected feedback. section 7.0 section 7.3
A practical classification workflow:
- Call SNOWFLAKE.CORTEX.SENTIMENT with each review as its input. section 7.3
- Interpret the returned score on a scale from −1 to 1: lower values indicate negative sentiment, higher values positive sentiment, and values near the middle neutral sentiment. section 7.3
- Map scores below −0.7 to Negative, scores below 0.4 to Neutral, and remaining scores to Positive; adjust the boundaries after reviewing results. section 7.3
- Use the resulting class to filter reviews or track the distribution of positive and negative feedback over time. section 7.3
Classify reviews in SQL
Select each review, calculate its Snowflake Cortex sentiment score, and derive a categorical sentiment with CASE. For example, “The service was excellent!” produces 0.7691993, while “The bagel was stale.” produces a negative score. section 7.3
select
rating,
time_created,
customer_review,
SNOWFLAKE.CORTEX.SENTIMENT(customer_review) as sentiment_score,
case
when sentiment_score < -0.7 then 'Negative'
when sentiment_score < 0.4 then 'Neutral'
else 'Positive'
end as sentiment
from CUSTOMER_REVIEWS;
Runnable SQL combines review selection, Snowflake Cortex scoring, and CASE-based sentiment classification. section 7.3











