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>
--format <format>
--verbose
--debug
--silent
引数¶
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
構成で定義された接続ではなく、コマンドラインパラメーターで定義された接続を使用します。デフォルト: false。
--mfa-passcode TEXT
多要素認証(MFA)に使用するトークン。
--enable-diag
Pythonコネクター診断テストを実行します。デフォルト: false。
--diag-log-path TEXT
診断レポートパス。デフォルト: <temporary_directory>
--diag-allowlist-path TEXT
オプションの許可リストへの診断レポートパス。
--format [TABLE|JSON]
出力形式を指定します。デフォルト: TABLE
--verbose, -v
ログレベル
info
以上のログエントリを表示します。デフォルト: false。--debug
ログレベル
debug
以上のログ エントリを表示します。デバッグログには追加情報が含まれます。デフォルト: false。--silent
コンソールへの中間出力をオフにします。デフォルト: 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).