共用方式為


ai_summarize 函式

適用於:check marked yes Databricks SQL

重要

這項功能處於公開預覽狀態

在預覽中,

  • 基礎語言模型可以處理數種語言,不過這些函式會針對英文進行調整。
  • 基礎基礎模型 API 有速率限制,請參閱 基礎模型 API 限制 來更新這些限制。

ai_summarize() 式可讓您叫用最先進的產生 AI 模型,以使用 SQL 產生指定文字的摘要。 此函式會使用 Databricks Foundation Model API 所提供的端點的聊天模型。

需求

重要

目前可能使用的基礎模型會根據 Apache 2.0 授權或 Llama 2 社群授權來授權。 Databricks 建議檢閱這些授權,以確保符合任何適用的條款。 如果模型在未來根據 Databricks 的內部基準檢驗而表現更好,Databricks 可能會變更模型(以及此頁面提供的適用授權清單)。

目前, Mixtral-8x7B 指示 是支持這些 AI 函式的基礎模型。

語法

ai_summarize(content[, max_words])

引數

  • contentSTRING:表達式,要摘要的文字。
  • max_words:選擇性的非負整數數值表達式,代表傳回摘要文字中最費力的目標字數。 預設值為 50。 如果設定為 0,則沒有字限制。

傳回

STRING

如果 contentNULL,則結果為 NULL

範例

> SELECT ai_summarize(
    'Apache Spark is a unified analytics engine for large-scale data processing. ' ||
    'It provides high-level APIs in Java, Scala, Python and R, and an optimized ' ||
    'engine that supports general execution graphs. It also supports a rich set ' ||
    'of higher-level tools including Spark SQL for SQL and structured data ' ||
    'processing, pandas API on Spark for pandas workloads, MLlib for machine ' ||
    'learning, GraphX for graph processing, and Structured Streaming for incremental ' ||
    'computation and stream processing.',
    20
  )
 "Apache Spark is a unified, multi-language analytics engine for large-scale data processing
 with additional tools for SQL, machine learning, graph processing, and stream computing."