適用於:
Databricks SQL
Databricks Runtime
這個 ai_fix_grammar() 功能讓你能調用最先進的 AI 模型,利用 SQL 修正文本中的語法錯誤。 此函數會使用 Databricks Foundation Model APIs 所提供之聊天模型服務端點。
需求
Apache 2.0 授權
目前可能使用的底層模型依照 Apache 2.0 授權,版權屬於 © Apache 軟體基金會。 客戶應負責確保遵循適用的模型授權。
Databricks 建議檢閱這些授權,以確保符合任何適用的條款。 如果未來模型根據 Databricks 的內部基準檢驗而表現更好,Databricks 可能會變更模型(以及此頁面上提供的適用授權清單)。
此函式僅適用於支持 針對批次推斷優化之 AI Functions 的區域工作區。
此函數不適用於 Azure Databricks SQL Classic。
Databricks 執行時需 15.4 LTS 或以上。 建議使用 Databricks Runtime 18.2 或以上版本,以獲得最佳效能及使用最新功能。
語法
ai_fix_grammar(content)
引數
-
content:STRING運算式。
退貨
具有已更正文法的 STRING。
如果 content 是 NULL,結果就是 NULL。
範例
> SELECT ai_fix_grammar('This sentence have some mistake');
"This sentence has some mistakes"
> SELECT ai_fix_grammar('She dont know what to did.');
"She doesn't know what to do."
> SELECT ai_fix_grammar('He go to school every days.');
"He goes to school every day."