從文本中提取特定標籤對應的資訊。
文法
AI_EXTRACT([<resource_name>], <text>, <labels>)
參數
|
參數 |
說明 |
|
|
指定的資源名稱,可空 |
|
|
要提取資訊的文本 |
|
|
要提取的標籤數組 |
傳回值
-
返回一個包含所有提取標籤及其對應值的字串。
-
當輸入有值為 NULL 時返回 NULL。
-
結果為大模型產生,所以返回內容並不固定。
樣本
SET default_ai_resource = 'resource_name';
SELECT AI_EXTRACT('SelectDB is an MPP-based real-time data warehouse known for its high query speed.',
['product_name', 'architecture', 'key_feature']) AS Result;
+---------------------------------------------------------------------------------------+
| Result |
+---------------------------------------------------------------------------------------+
| product_name="SelectDB", architecture="MPP-based", key_feature="high query speed" |
+---------------------------------------------------------------------------------------+