snowflake.snowpark.functions.ai_classify¶
- snowflake.snowpark.functions.ai_classify(expr: Union[Column, str], list_of_categories: Union[Column, List[str]]) Column[source]¶
Classifies text or images into categories that you specify.
- Parameters:
expr – The string, image, or a SQL object from
prompt()that you’re classifying. If you’re classifying text, the input string is case sensitive. You might get different results if you use different capitalization.list_of_categories – An array of strings that represents the different categories. Categories are case-sensitive. The array must contain at least 2 and no more than 100 categories. If the requirements aren’t met, the function returns an error.
- Returns:
A serialized object. The object’s
labelfield is a string that specifies the category to which the input belongs. If you specify invalid values for the arguments, an error is returned.
Examples: