Skip to main content

LLM_FIXGRAMMAR

Description​

Used to correct grammatical errors in text.

Syntax​

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

Parameters​

ParameterDescription
<resource_name>The specified resource name, optional
<text>The text to be grammar-corrected

Return Value​

Returns the text string after grammar correction.

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_FIXGRAMMAR('Apache Doris a great system DB') AS Result;
+------------------------------------------+
| Result |
+------------------------------------------+
| Apache Doris is a great database system. |
+------------------------------------------+
SELECT LLM_FIXGRAMMAR('resource_name', 'I am like to using Doris') AS Result;
+--------------------+
| Result |
+--------------------+
| I like using Doris |
+--------------------+