に最終更新
AI_MASK
説明
指定したラベルに関連するテキスト中の機密情報をマスクします。
構文
AI_MASK([<resource_name>], <text>, <labels>)
引数
| 引数 | 説明 |
|---|---|
<resource_name> | 指定するリソース名 |
<text> | 機密情報を含む可能性があるテキスト |
<labels> | マスクするラベルの配列。例: ARRAY('name', 'phone', 'email') |
戻り値
機密情報をマスクしたテキストを返します。マスク箇所は "[MASKED]" に置き換えられます。
いずれかの入力が NULL の場合は NULL を返します。
結果は大規模言語モデルによって生成されるため、出力は変わることがあります。
例
SET default_ai_resource = 'resource_name';
SELECT AI_MASK('Wccccat is a 20-year-old Doris community contributor.', ['name', 'age']) AS Result;
+-----------------------------------------------------+
| Result |
+-----------------------------------------------------+
| [MASKED] is a [MASKED] Doris community contributor. |
+-----------------------------------------------------+
SELECT AI_MASK('resource_name', 'My email is rarity@example.com and my phone is 123-456-7890',
['email', 'phone_num']) AS RESULT;
+-----------------------------------------------+
| RESULT |
+-----------------------------------------------+
| My email is [MASKED] and my phone is [MASKED] |
+-----------------------------------------------+