用於將文本分類到指定的標籤集合中。
文法
AI_CLASSIFY([<resource_name>], <text>, <labels>)
參數
|
參數 |
說明 |
|
|
指定的資源名稱, 可空 |
|
|
需要分類的文本 |
|
|
分類標籤數組 |
傳回值
-
返迴文本最匹配的單個標籤字串。
-
當輸入有值為 NULL 時返回 NULL。
-
結果為大模型產生,所以返回內容並不固定。
樣本
SET default_ai_resource = 'resource_name';
SELECT AI_CLASSIFY('SelectDB is a databases system.', ['useage', 'introduce']) AS Result;+-----------+
| Result |
+-----------+
| introduce |
+-----------+
SELECT AI_CLASSIFY('resource_name', 'SelectDB is developing rapidly.', ['science', 'sport']) AS Result;+---------+
| Result |
+---------+
| science |
+---------+