0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Snowflake Cortexを触ってみよう

AI方面への進出が著しいSnowflake、ちょっと試してみます。
SNOWFLAKEデータベースの下にCORTEXってスキーマができてるんですね。
ちょっと世界の人口でも聞いてみますか。

SELECT SNOWFLAKE.CORTEX.COMPLETE('snowflake-arctic', '世界の国で人口の多いTOP10を出してください。') as response;

以下のエラーが出ました。

100351 (P0000): Request failed for external function COMPLETE$V2 with remote service error: 400 '"unknown model "snowflake-arctic""

snowflake-arcticはunknown modelだそうです。
そうなの?
使うモデルを変えてみましょう。

SELECT SNOWFLAKE.CORTEX.COMPLETE('reka-core', '世界の国で人口の多いTOP10を出してください。') as response;

100351 (P0000): Request failed for external function COMPLETE$V2 with remote service error: 400 '"unknown model "reka-core""

reka-coreもunknown modelだそうです。ぐぬぬ。
もう一個別のモデルで試してみます。

SELECT SNOWFLAKE.CORTEX.COMPLETE('llama3-8b', '世界の国で人口の多いTOP10を出してください。') as response;

RESPONSE
Here are the top 10 countries by population in the world, based on the latest estimates from the United Nations (2020):

  1. China: 1.439 billion (18.5% of the world's population)
  2. India: 1.380 billion (17.7% of the world's population)
  3. United States: 331.4 million (4.3% of the world's population)
  4. Indonesia: 273.5 million (3.6% of the world's population)
  5. Pakistan: 216.6 million (2.8% of the world's population)
  6. Brazil: 212.2 million (2.7% of the world's population)
  7. Nigeria: 202.9 million (2.6% of the world's population)
  8. Bangladesh: 166.3 million (2.1% of the world's population)
  9. Russia: 145.9 million (1.9% of the world's population)
  10. Japan: 127.1 million (1.6% of the world's population)

Note: These numbers are estimates and may vary slightly depending on the source.

キターーー。
でも英語で回答来るんですね、日本語で回答してくれるようお願いしましょう。

SELECT SNOWFLAKE.CORTEX.COMPLETE('llama3-8b', '日本語で回答してください。') as response;

RESPONSE
日本語で回答します。何質問ですか?

あれ?前の質問は覚えてないんですね。
ブラウザでChatGPTやClaudeに聞くのとは違うようです。

日本語で回答してくれるよう追加します。

SELECT SNOWFLAKE.CORTEX.COMPLETE('llama3-8b', '世界の国で人口の多いTOP10を出してください。日本語で回答してください。') as response;

RESPONSE
以下は、世界の国で人口の多いTOP10です。

  1. 中国:約14億人(2020年推定)
  2. インド:約13億人(2020年推定)
  3. アメリカ合衆国:約3億4千万人(2020年推定)
  4. インドネシア:約2億9千万人(2020年推定)
  5. パキスタン:約2億6千万人(2020年推定)
  6. ブラジル:約2億5千万人(2020年推定)
  7. ニガリア:約2億4千万人(2020年推定)
  8. ベンガルデシ:約2億3千万人(2020年推定)
  9. ロシア:約1億9千万人(2020年推定)
  10. メキシコ:約1億8千万人(2020年推定)

Note: 人口の推定値は2020年現在のものです。

二ガリアというのは英語の方を見るとナイジェリアですね。
同様にベンガルデシはバングラデシュ。
10位がメキシコになってますが、英語の回答ではJapanでしたよ。
英語の回答は何年のものか書いてなくて日本語は2020年現在のものと但し書きがあります。
この違いでしょうか?
とはいえメキシコが1億2700万人の日本に抜かれたとは思えないです。
メキシコで2020年以降に人口の2/3くらいが虐殺されたんでしょうか?そんなニュース聞いたことないです。
ちょっと答えが怪しいですね。
ちなみに「メキシコ 人口」でググったら1.28億人(2022)と出ました。
約1億8千万人(2020年推定)
という回答が間違ってるくさいです。

Cortexを試してみるところはできたのですが、なんか使えるのか微妙な結果となりました。
モデルを他のにしたら精度は変わると思いますが、何となく試したllama3-8bだとこんな感じです。

詳しい方、いろいろ教えてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?