snow cortex summarize¶
指定された英語の入力テキストを要約します。
構文¶
snow cortex summarize
<text>
--file <file>
--connection <connection>
--host <host>
--port <port>
--account <account>
--user <user>
--password <password>
--authenticator <authenticator>
--private-key-file <private_key_file>
--token-file-path <token_file_path>
--database <database>
--schema <schema>
--role <role>
--warehouse <warehouse>
--temporary-connection
--mfa-passcode <mfa_passcode>
--enable-diag
--diag-log-path <diag_log_path>
--diag-allowlist-path <diag_allowlist_path>
--oauth-client-id <oauth_client_id>
--oauth-client-secret <oauth_client_secret>
--oauth-authorization-url <oauth_authorization_url>
--oauth-token-request-url <oauth_token_request_url>
--oauth-redirect-uri <oauth_redirect_uri>
--oauth-scope <oauth_scope>
--oauth-disable-pkce
--oauth-enable-refresh-tokens
--oauth-enable-single-use-refresh-tokens
--client-store-temporary-credential
--format <format>
--verbose
--debug
--silent
--enhanced-exit-codes
引数¶
text
要約を生成する英語のテキストを含む文字列。--fileオプションと組み合わせることはできません。
オプション¶
--file FILE
要約を生成する英語のテキストを含むファイル。TEXT 引数と組み合わせることはできません。
--connection, -c, --environment TEXT
config.toml
ファイルで定義されている接続の名前。デフォルト:デフォルト
--host TEXT
接続用のホストアドレス。接続に指定された値を上書きします。
--port INTEGER
接続のポート。接続に指定された値を上書きします。
--account, --accountname TEXT
Snowflakeアカウントに割り当てられた名前。接続に指定された値を上書きします。
--user, --username TEXT
Snowflakeに接続するユーザー名。接続に指定された値を上書きします。
--password TEXT
Snowflakeのパスワード。接続に指定された値を上書きします。
--authenticator TEXT
Snowflakeの認証コード。接続に指定された値を上書きします。
--private-key-file, --private-key-path TEXT
Snowflake プライベートキーファイルへのパス。接続に指定された値を上書きします。
--token-file-path TEXT
Snowflake接続時に使用する OAuth トークンを含むファイルへのパス。
--database, --dbname TEXT
使用するデータベース。接続に指定された値を上書きします。
--schema, --schemaname TEXT
使用するデータベーススキーマ。接続に指定された値を上書きします。
--role, --rolename TEXT
使用するロール。接続に指定された値を上書きします。
--warehouse TEXT
使用するウェアハウス名。接続に指定された値を上書きします。
--temporary-connection, -x
config で定義された接続ではなく、コマンドラインパラメーターで定義された接続を使用します。デフォルト: false。
--mfa-passcode TEXT
多要素認証(MFA)に使用するトークン。
--enable-diag
接続診断レポートを作成するかどうか。デフォルト: false。
--diag-log-path TEXT
生成されたレポートのパス。デフォルトはシステム仮ディレクトリです。デフォルト: <system_temporary_directory>.
--diag-allowlist-path TEXT
allowlist パラメーターを含む JSON ファイルへのパス。
--oauth-client-id TEXT
Snowflake統合のためにIDプロバイダーが提供するクライアントIDの値。
--oauth-client-secret TEXT
Snowflake 統合用に ID プロバイダーが提供するクライアントシークレットの値。
--oauth-authorization-url TEXT
認証コードをドライバーに提供する ID プロバイダーエンドポイント。
--oauth-token-request-url TEXT
ドライバーにアクセストークンを供給する ID プロバイダーのエンドポイント。
--oauth-redirect-uri TEXT
URI 認証コードのリダイレクトに使用します。
--oauth-scope TEXT
ID プロバイダー承認リクエストで要求された範囲。
--oauth-disable-pkce
コード交換の証明キー (PKCE) を無効にします。デフォルト:
False
。--oauth-enable-refresh-tokens
実際のアクセストークンが古くなった場合に、サイレント再認証コードを有効にします。デフォルト:
False
。--oauth-enable-single-use-refresh-tokens
シングルユース・更新・トークンのセマンティクスにオプトインするかどうか。デフォルト:
False
。--client-store-temporary-credential
仮認証情報を保存します。
--format [TABLE|JSON]
出力形式を指定します。デフォルト: TABLE
--verbose, -v
ログレベル
info
以上のログエントリを表示します。デフォルト: false。--debug
ログレベル
debug
以上のログ エントリを表示します。デバッグログには追加情報が含まれます。デフォルト: false。--silent
コンソールへの中間出力をオフにします。デフォルト: false。
--enhanced-exit-codes
終了エラーコードをエラーのタイプによって区別します。デフォルト: false。
--help
このコマンドのヘルプテキストを表示します。
使用上の注意¶
なし。
例¶
コマンドラインで指定されたテキストを要約します。
snow cortex summarize "John has a car. John's car is blue. John's car is old and John is thinking about buying a new car. There are a lot of cars to choose from and John cannot sleep because it's an important decision for John."
John has an old blue car and is considering buying a new one due to the many options available, causing him sleepless nights.
ファイルに保存されたテキストを要約します。
この例では、ファイル
about_cortex.txt
に以下の内容が含まれていると仮定します。Snowflake Cortex gives you instant access to industry-leading large language models (LLMs) trained by researchers at companies like Mistral, Reka, Meta, and Google, including Snowflake Arctic, an open enterprise-grade model developed by Snowflake. Since these LLMs are fully hosted and managed by Snowflake, using them requires no setup. Your data stays within Snowflake, giving you the performance, scalability, and governance you expect. Snowflake Cortex features are provided as SQL functions and are also available in Python. The available functions are summarized below. COMPLETE: Given a prompt, returns a response that completes the prompt. This function accepts either a single prompt or a conversation with multiple prompts and responses. EMBED_TEXT_768: Given a piece of text, returns a vector embedding that represents that text. EXTRACT_ANSWER: Given a question and unstructured data, returns the answer to the question if it can be found in the data. SENTIMENT: Returns a sentiment score, from -1 to 1, representing the detected positive or negative sentiment of the given text. SUMMARIZE: Returns a summary of the given text. TRANSLATE: Translates given text from any supported language to any other.
次のようにファイル名を渡してsnow cortexコマンドを実行します。
snow cortex summarize --file about_cortex.txt
Snowflake Cortex offers instant access to industry-leading language models, including Snowflake Arctic, with SQL functions for completing prompts (COMPLETE), text embedding (EMBED\_TEXT\_768), extracting answers (EXTRACT\_ANSWER), sentiment analysis (SENTIMENT), summarizing text (SUMMARIZE), and translating text (TRANSLATE).