SnowPro Specialty: Gen AI Question 95
Single answerCLASSIFY_TEXTA retail company stores thousands of customer support tickets in a Snowflake table. The analytics team wants to automatically route each ticket into one of four categories: BILLING, SHIPPING, RETURNS, or TECH_SUPPORT. They need a solution that runs directly in SQL, minimizes custom model development, and returns one label per ticket for downstream reporting. Which approach best meets this requirement using Snowflake Cortex?
- A
Use CLASSIFY_TEXT on the ticket text and provide the four target categories so the function returns the best matching label for each row.
- B
Use COMPLETE with a general prompt and expect deterministic category labels without defining the allowed classes.
- C
Use EMBED_TEXT_768 and assign the category based only on vector size, because larger vectors indicate more specific classes.
- D
Use TRANSLATE to normalize the ticket language first, because CLASSIFY_TEXT only works on English text and cannot classify multilingual input.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use CLASSIFY_TEXT because the scenario describes a standard supervised-style classification task with a known set of categories and a need for SQL-native execution in Snowflake. CLASSIFY_TEXT is the purpose-built Cortex function for assigning text to one of the provided classes, making it more appropriate than a general generation function like COMPLETE. EMBED_TEXT functions support semantic search, clustering, and similarity workflows, but they do not directly output the required labels. As a best practice, use a purpose-built classification function when the categories are known in advance and downstream systems need consistent labels for reporting and automation. Refer to Snowflake Cortex documentation for CLASSIFY_TEXT usage patterns and supported SQL-based AI functions.
- A. Correct.
Correct. CLASSIFY_TEXT is designed for text classification tasks in SQL, where you provide the input text and the candidate labels/classes. In this scenario, the team needs one label per ticket from a known set of categories, with minimal custom model development. That is exactly the practical use case for CLASSIFY_TEXT in Snowflake Cortex.
- B. Incorrect.
Incorrect. COMPLETE can sometimes be prompted to classify text, but it is a more general text-generation function and is not the best fit when the requirement is controlled classification into a predefined set of labels. Without constraining the output to an allowed class list, responses may vary in wording and formatting, which creates problems for routing and reporting.
- C. Incorrect.
Incorrect. EMBED_TEXT_768 generates embeddings for semantic similarity and downstream vector-based workflows; it does not directly assign business labels. Vector size is fixed by the model output and does not indicate category specificity. A candidate might choose this option because embeddings are often used in ML pipelines, but by themselves they do not solve this classification requirement.
- D. Incorrect.
Incorrect. TRANSLATE is not the right primary solution for this requirement, and the statement that CLASSIFY_TEXT only works on English text is not a valid assumption to rely on. Even if translation were useful in some multilingual workflows, the core requirement is predefined label assignment in SQL, which CLASSIFY_TEXT is intended to address directly.