感情の抽出

注釈

AI_SENTIMENT は ENTITY_SENTIMENT (SNOWFLAKE.CORTEX) の更新されたバージョンです。最新の関数については、 AI_SENTIMENT を使用してください。

AI_SENTIMENT 関数は、様々な市場や言語全体での最先端の品質感情分類を実現します。AI_SENTIMENT を使用すると、以下のようなユースケースにおいて、全体的および詳細の両方のアスペクトベースの感情分析結果を取得できます。

  • ソーシャルメディアのモニタリング

  • 詳細な製品分析

  • 包括的なブランド認知調査

  • 高度なマーケット・インテリジェンス

  • 従業員のエンゲージメント分析

  • カスタマー経験ジャーニー マッピング

  • コンテンツのパフォーマンス分析

  • 顧客サポートの最適化

感情抽出の品質

AI_SENTIMENT は、業界トップクラスの全体的な感情とアスペクトベースの感情に関する精度を実現する、カスタムのSnowflake大規模言語モデルを使用しています。次のテーブルには、一般的なモデルと対比して AI_SENTIMENT が全体的な感情およびアスペクトベースの感情(ABSA混合)ベンチマークを実行する方法に関する情報を記載しています。多言語ベンチマークで評価される言語は、英語、スペイン語、フランス語、ドイツ語、ヒンディー語、イタリア語、ポルトガル語です。

注釈

ベンチマーク済みモデルの一部は、Snowflake Cortexでは利用できません。


モデル
アスペクトベースの感情
精度(ABSA-mix
アスペクトベースの感情
精度(ABSA-multilingual
全体的な感情
精度
全体的な感情
精度(多言語)

Cortex AI AI_SENTIMENT

0.92

0.81

0.83

0.83

claude-4-sonnet

0.84

0.79

0.75

0.82

mistral-large2

0.83

0.80

0.77

0.78

openai-gpt-4.1

0.83

0.73

0.80

0.78

llama4-scout

0.82

0.79

0.71

0.76

llama3.3-70b

0.82

0.79

0.71

0.76

AWS に DetectSentiment

0.62

0.64

AI_SENTIMENT 関数の呼び出し

デフォルトでは、Cortex AI_SENTIMENT は、コンテンツ全体に関する全体的な感情スコアを返します。ただし、AI_SENTIMENT は全体的なポジティブ、ネガティブ、ニュートラルのバケットを超えた、顧客の意見のスペクトラムを把握することもできます。このオプションのアスペクトベースの感情分析では、感情を分析するコンテンツ(お客様のコメントやレビューなど)とアスペクト(エンティティまたはカテゴリとも呼ばれます)を指定します。AI_SENTIMENT は、各エンティティの感情と全体的な感情を返します。全体的な感情のみを取得するには、アスペクトなしでコンテンツを指定します。

英語の例

次の例では、AI_SENTIMENT を使用して製品レビューの感情分類を取得しています。

SELECT AI_SENTIMENT('I went to the store, bought the leggings and exact same as shorts...
  they are expensive but i heard such great things. After wearing them twice i noticed a string popping out already.
  And aince i believed that they were this amazing luxury brand i didnt keep the receipt 😭 ');
Copy

戻り値:

{
  "categories": [
    {
      "name": "overall",
      "sentiment": "mixed"
    }
  ]
}

次の例では、AI_SENTIMENT を使用してレストランに関するレビューの特定のアスペクトに対する感情分類を取得しています。

SELECT AI_SENTIMENT('A tourist\'s delight, in low urban light,
  Recommended gem, a pizza night sight. Swift arrival, a pleasure so right,
  Yet, pockets felt lighter, a slight pricey bite. 💰🍕🚀',
  ['Cost', 'Quality' ,'Wait Time']);
Copy

戻り値:

{
  "categories": [
    {
      "name": "overall",
      "sentiment": "mixed"
    },
    {
      "name": "Cost",
      "sentiment": "negative"
    },
    {
      "name": "Quality",
      "sentiment": "positive"
    },
    {
      "name": "Wait Time",
      "sentiment": "positive"
    }
  ]
}

指定したアスペクトの一部が提供したテキストに適用されない場合、AI_SENTIMENT は次の例のプロフェッショナリズムとブランドに示されているように、これらのアスペクトに対して「不明」を返します。

SELECT AI_SENTIMENT('A tourist\'s delight, in low urban light,
  Recommended gem, a pizza night sight. Swift arrival, a pleasure so right,
  Yet, pockets felt lighter, a slight pricey bite. 💰🍕🚀',
  ['Cost', 'Professionalism' ,'Brand']);
Copy

戻り値:

{
  "categories": [
    {
      "name": "overall",
      "sentiment": "mixed"
    },
    {
      "name": "Brand",
      "sentiment": "unknown"
    },
    {
      "name": "Cost",
      "sentiment": "negative"
    },
    {
      "name": "Professionalism",
      "sentiment": "unknown"
    }
  ]
}

多言語の例

次の2つの類似した例に示すように、AI_SENTIMENT は複数の言語で感情を分析できるため、テキストを翻訳する必要がなく、その意味の重要な部分が失われるリスクはありません。テキストの言語を指定する必要はありません。アスペクトは、次の例に示すようにテキストの言語で指定するか、2番目の例に示すように英語で指定できます。

注釈

AI_SENTIMENT は、英語、フランス語、ドイツ語、ヒンディー語、イタリア語、スペイン語、ポルトガル語をサポートしています。

スペイン語のテキストとラベルの両方がある例:

SELECT AI_SENTIMENT ('Pedí dos pares del mismo modelo en diferentes colores.
    Uno tenía defectos en la costura y el cuero se veía de menor calidad.
    Por 350€ el par, esto es inaceptable. El servicio al cliente tardó una
    semana en responder y la solución no fue satisfactoria. Es una pena porque
    cuando están bien hechos, son zapatos hermosos. Pero la inconsistencia en la
    calidad es preocupante.', ['Calidad', 'Calidad de Servicio,' 'Precio', 'Tiempo de Espera']);
Copy

戻り値:

{
  "categories": [
    {
      "name": "overall",
      "sentiment": "negative"
    },
    {
      "name": "Calidad",
      "sentiment": "negative"
    },
    {
      "name": "Calidad de Servicio",
      "sentiment": "negative"
    },
    {
      "name": "Precio",
      "sentiment": "negative"
    },
    {
      "name": "Tiempo de Espera",
      "sentiment": "negative"
    }
  ]
}

ドイツ語のテキストと英語のラベルがある例:

SELECT AI_SENTIMENT ('Die Schuhe selbst sind wirklich schön und gut verarbeitet.
    Das Leder ist weich und die Passform stimmt. Allerdings gab es erhebliche
    Verzögerungen bei der Lieferung - statt der versprochenen 5 Tage hat es 3
    Wochen gedauert. Der Kundenservice war freundlich, aber nicht sehr hilfreich.
    Für 320€ erwarte ich besseren Service. Die Schuhe sind in Ordnung, aber das
    Gesamterlebnis war mittelmäßig', ['Quality', 'Price', 'Service', 'WaitTime']);
Copy

戻り値:

{
  "categories": [
    {
      "name": "overall",
      "sentiment": "mixed"
    },
    {
      "name": "Price",
      "sentiment": "neutral"
    },
    {
      "name": "Quality",
      "sentiment": "positive"
    },
    {
      "name": "Service",
      "sentiment": "neutral"
    },
    {
      "name": "WaitTime",
      "sentiment": "negative"
    }
  ]
}

モデルの制限

All large language models (LLMs) available in Snowflake Cortex AI have limitations on the total number of input and output tokens, which is referred to as the model's context window. Inputs exceeding the context window limit result in an error. Output which would exceed the context window limit is truncated.

AI_SENTIMENT のコンテキストウィンドウは、モデルが高いレベルの精度を維持できるように設定されています。AI_SENTIMENT は2,048トークン(約1,600語)のテキスト入力用にトレーニングおよび最適化されています。最大10個のアスペクトを指定できます。それぞれを30文字以下にする必要があります。

関数

コンテキストウィンドウ(トークン)

エンティティラベルの最大数

AI_SENTIMENT

2,048

10