跳到主要内容

LLM_SENTIMENT

描述

用于分析文本的情感倾向

语法

LLM_SENTIMENT([<resource_name>], <text>)

参数

参数说明
<resource_name>指定的资源名称
<text>需要分析情感的文本

返回值

返回情感分析结果,可能的值包括:

  • positive(积极)
  • negative(消极)
  • neutral(中性)
  • mixed(混合)

当输入有值为 NULL 时返回 NULL

结果为大模型生成,所以返回内容并不固定

示例

SET default_llm_resource = 'resource_name';
SELECT LLM_SENTIMENT('Apache Doirs is a great DB system.') AS Result;
+----------+
| Result |
+----------+
| positive |
+----------+
SELECT LLM_SENTIMENT('resrouce_name', 'I hate sunny days.') AS Result;
+----------+
| Result |
+----------+
| negative |
+----------+