Skip to main content

LLM_SENTIMENT

Description​

Used to analyze the sentiment of text.

Syntax​

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

Parameters​

ParameterDescription
<resource_name>The specified resource name
<text>The text to analyze sentiment for

Return Value​

Returns the sentiment analysis result. Possible values include:

  • positive
  • negative
  • neutral
  • mixed

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_SENTIMENT('Apache Doris is a great DB system.') AS Result;
+----------+
| Result |
+----------+
| positive |
+----------+
SELECT LLM_SENTIMENT('resource_name', 'I hate sunny days.') AS Result;
+----------+
| Result |
+----------+
| negative |
+----------+