QuestionQ80

Snowflake Gen AI & LLM Functions

Review this query:

Question Image

What will be the result of this query?

  • A {“label”: “travel”}
  • B {“label”: “fitness”}
  • C “fitness”
  • D {‘label’: ‘fitness’,‘description’: ‘Hobbies related to being active and healthy’}
Explanation

Snowflake Cortex's CLASSIFY_TEXT function classifies the given input text against the supplied list of category objects (each with a label, and optionally a description and examples) and returns a JSON object containing the 'label' of the best-matching category. The input text 'I love morning walks' semantically aligns with the 'fitness' category, described as 'Hobbies related to being active and healthy', rather than 'travel' (going from one place to another) or 'cooking'. The function's return value is a JSON object of the form {'label': '<chosen_label>'}, containing only the label field — not the full category definition (which would include the description) and not a plain string.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!