LLM_CLASSIFY
Descriptionβ
Used to classify text into a specified set of labels.
Syntaxβ
LLM_CLASSIFY([<resource_name>], <text>, <labels>)
Parametersβ
Parameter | Description |
---|---|
<resource_name> | The specified resource name, optional |
<text> | The text to be classified |
<labels> | Array of classification labels |
Return Valueβ
Returns the single label that best matches the text.
If any input is NULL, returns NULL.
The result is generated by a large language model, so the output may vary.
Examplesβ
SET default_llm_resource = 'resource_name';
SELECT LLM_CLASSIFY('Apache Doris is a databases system.', ['useage', 'introduce']) AS Result;
+-----------+
| Result |
+-----------+
| introduce |
+-----------+
SELECT LLM_CLASSIFY('resource_name', 'Apache Doris is developing rapidly.', ['science', 'sport']) AS Result;
+---------+
| Result |
+---------+
| science |
+---------+