snowflake.cortex.classify_text

snowflake.cortex.classify_text(str_input: str | Column, categories: list[str] | Column, session: Session | None = None) str | Column

Use the LLM inference service to classify the INPUT text into one of the target CATEGORIES.

Parameters:
  • str_input – A Column of strings to classify.

  • categories – A list of candidate categories to classify the INPUT text into.

  • session – The snowpark session to use. Will be inferred by context if not specified.

Returns:

A column of classification responses.