SnowPro Specialty: Gen AI Question 102
Single answerSENTIMENTA retail company stores post-purchase survey comments in a Snowflake table named CUSTOMER_FEEDBACK with columns FEEDBACK_ID, COMMENT_TEXT, and CREATED_AT. The analytics team wants to classify each comment as positive, negative, neutral, or mixed directly in Snowflake so they can build a dashboard showing weekly sentiment trends. They also want a solution that minimizes custom model development and works on unstructured text. Which approach best meets these requirements?
- A
Use Snowflake Cortex SENTIMENT on COMMENT_TEXT in a SQL query or view, and aggregate the returned sentiment labels by week for reporting.
- B
Train a custom Snowpark ML regression model because sentiment classification in Snowflake requires numeric prediction rather than text category output.
- C
Convert each comment into embeddings first, then use vector similarity alone to determine whether the sentiment is positive or negative without any labeled examples.
- D
Use a standard SQL AVG() on COMMENT_TEXT after tokenizing the text, because Snowflake can infer sentiment directly from average token values.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use Snowflake Cortex SENTIMENT because it is designed for sentiment analysis on unstructured text directly within Snowflake SQL, which fits the team's requirement to avoid custom model development. In a real implementation, the team could create a view or query that applies SENTIMENT(COMMENT_TEXT), derive a weekly bucket from CREATED_AT, and aggregate counts or percentages by sentiment label for dashboard consumption. This approach is operationally simpler and aligns with Snowflake best practices of using built-in AI functions when they satisfy the use case. By contrast, training a custom model is appropriate only when built-in capabilities are insufficient or domain-specific tuning is required. Embeddings support semantic tasks but are not a standalone sentiment classifier. Basic SQL functions also cannot replace an NLP sentiment model. Candidates should recognize when to use native Cortex functions for practical analytics workflows involving text.
- A. Correct.
Correct. Snowflake Cortex provides a SENTIMENT function for analyzing unstructured text directly in SQL. This is the most practical choice when the goal is to classify comments without building and maintaining a custom model. The team can apply SENTIMENT to COMMENT_TEXT and then aggregate results by date parts such as week for dashboarding.
- B. Incorrect.
Incorrect. A custom Snowpark ML model is not the best fit when Snowflake already provides built-in sentiment analysis for text. This option adds unnecessary complexity, requires labeled training data and model lifecycle management, and does not align with the requirement to minimize custom model development.
- C. Incorrect.
Incorrect. Embeddings are useful for semantic similarity, clustering, and retrieval, but vector similarity by itself does not reliably produce sentiment labels such as positive, negative, neutral, or mixed. Without a labeled sentiment approach or a dedicated sentiment function, this would not meet the requirement accurately.
- D. Incorrect.
Incorrect. Standard SQL aggregation functions like AVG() do not infer sentiment from text. Tokenization alone does not create meaningful sentiment scores unless combined with a sentiment model or lexicon-based method. This reflects a common misconception that text can be analyzed for sentiment using basic SQL arithmetic.