汎用評価器(クラシック)

現在表示中:Foundry (クラシック) ポータルのバージョン - 新しい Foundry ポータルのバージョンに切り替える

Note

Microsoft Foundry SDK for evaluation および Foundry ポータルはパブリック プレビュー段階ですが、API はモデルとデータセットの評価に一般提供されています (エージェントの評価はパブリック プレビューのままです)。 この記事でマークされている Azure AI Evaluation SDK とエバリュエーター (プレビュー) は、現在、あらゆる場所でパブリック プレビュー段階にあります。

AIシステムは、文章の応答が一貫性に欠けていたり、最低限の文法的正確さ以上の一般的な文章品質を欠いたりすることもあります。 これらの問題に対処するために、Microsoft Foundryは一貫性と流暢さの評価をサポートしています。

contextデータとground truthデータに加え、queryresponseの両方を含む質問応答(QA)シナリオがある場合は、関連する評価者を判断に据える複合評価ツールであるQAEvaluatorも利用できます。

AI支援評価者向けモデル構成

以下のコードスニペットの参考として、AI支援評価者は以下のモデル構成を使用しています。

import os
from azure.ai.evaluation import AzureOpenAIModelConfiguration
from dotenv import load_dotenv
load_dotenv()

model_config = AzureOpenAIModelConfiguration(
    azure_endpoint=os.environ["AZURE_ENDPOINT"],
    api_key=os.environ.get("AZURE_API_KEY"),
    azure_deployment=os.environ.get("AZURE_DEPLOYMENT_NAME"),
    api_version=os.environ.get("AZURE_API_VERSION"),
)

評価者モデルのサポート

Foundryは、評価者に応じて大規模言語モデル審査員(LLM-judge)に対してAzureOpenAIまたはOpenAI の推論モデル および非推論モデルをサポートしています。

Evaluators 審判としての推論モデル(例:Azure OpenAI / OpenAIのo系列モデル) 非推論モデルをジャッジとして使う場合(例:gpt-4.1、gpt-4oなど) To enable
IntentResolutionTaskAdherenceToolCallAccuracyResponseCompletenessCoherenceFluencySimilarityGroundednessRetrievalRelevance Supported Supported イッショナル化時に追加のパラメータ is_reasoning_model=True を設定します
Other evaluators Not Supported Supported --

洗練された推論を必要とする複雑な評価には、推論性能とコスト効率のバランスを取った強力な推論モデル( 4.1-mini )を推奨します。

Coherence

コヒーレンス エバリュエーターは、応答でアイデアの論理的かつ順序的なプレゼンテーションを測定します。これにより、読者はライターの思考のトレーニングに簡単に従って理解できます。 一貫性のある応答は、適切な遷移と論理的な一連のアイデアを使用して、文と段落の間の明確なつながりを持つ質問に直接対処します。 スコアが高いほど、一貫性が向上します。

Coherence example

from azure.ai.evaluation import CoherenceEvaluator

coherence = CoherenceEvaluator(model_config=model_config, threshold=3)
coherence(
    query="Is Marie Curie is born in Paris?", 
    response="No, Marie Curie is born in Warsaw."
)

Coherence output

リッカート尺度(整数1から5)の数値スコア。 スコアが高いほど良いです。 数値の閾値(デフォルトは3)が与えられると、スコアが>=閾値であれば合格、そうでなければ失敗します。 理由欄を使って、なぜスコアが高いのか低いのかを理解しましょう。

{
    "coherence": 4.0,
    "gpt_coherence": 4.0,
    "coherence_reason": "The RESPONSE is coherent and directly answers the QUERY with relevant information, making it easy to follow and understand.",
    "coherence_result": "pass",
    "coherence_threshold": 3
}

Fluency

流暢性エバリュエーターは、書かれたコミュニケーションの有効性と明確さを測定します。 このメジャーでは、文法の精度、ボキャブラリ範囲、文の複雑さ、一貫性、および全体的な読みやすさに重点を置いています。 これは、アイデアがどれだけスムーズに伝わるか、および読者がテキストをどれだけ簡単に理解できるかを評価します。

Fluency example

from azure.ai.evaluation import FluencyEvaluator

fluency = FluencyEvaluator(model_config=model_config, threshold=3)
fluency(
    response="No, Marie Curie is born in Warsaw."
)

Fluency output

リッカート尺度(整数1から5)の数値スコア。 スコアが高いほど良いです。 数値の閾値(デフォルトは3)が与えられると、スコアが>=閾値であれば合格、そうでなければ失敗します。 理由欄を使って、なぜスコアが高いのか低いのかを理解しましょう。

{
    "fluency": 3.0,
    "gpt_fluency": 3.0,
    "fluency_reason": "The response is clear and grammatically correct, but it lacks complexity and variety in sentence structure, which is why it fits the \"Competent Fluency\" level.",
    "fluency_result": "pass",
    "fluency_threshold": 3
}

質問回答コンポジット評価ツール

QAEvaluator 質問応答シナリオにおけるさまざまな側面を包括的に測定します。

  • Relevance
  • Groundedness
  • Fluency
  • Coherence
  • Similarity
  • F1 スコア

QA example

from azure.ai.evaluation import QAEvaluator

qa_eval = QAEvaluator(model_config=model_config, threshold=3)
qa_eval(
    query="Where was Marie Curie born?", 
    context="Background: 1. Marie Curie was a chemist. 2. Marie Curie was born on November 7, 1867. 3. Marie Curie is a French scientist.",
    response="According to wikipedia, Marie Curie was not born in Paris but in Warsaw.",
    ground_truth="Marie Curie was born in Warsaw."
)

QA output

F1スコアは0-1フロートスケールの数値スコアを出力しますが、他の評価者はリッカートスケール(整数1から5)で数値スコアを出力します。 スコアが高いほど良いです。 数値の閾値(デフォルトは3)が与えられると、スコアが>=閾値であれば合格、そうでなければ失敗します。 理由欄を使って、なぜスコアが高いのか低いのかを理解しましょう。

{
    "f1_score": 0.631578947368421,
    "f1_result": "pass",
    "f1_threshold": 3,
    "similarity": 4.0,
    "gpt_similarity": 4.0,
    "similarity_result": "pass",
    "similarity_threshold": 3,
    "fluency": 3.0,
    "gpt_fluency": 3.0,
    "fluency_reason": "The input Data should get a Score of 3 because it clearly conveys an idea with correct grammar and adequate vocabulary, but it lacks complexity and variety in sentence structure.",
    "fluency_result": "pass",
    "fluency_threshold": 3,
    "relevance": 3.0,
    "gpt_relevance": 3.0,
    "relevance_reason": "The RESPONSE does not fully answer the QUERY because it fails to explicitly state that Marie Curie was born in Warsaw, which is the key detail needed for a complete understanding. Instead, it only negates Paris, which does not fully address the question.",
    "relevance_result": "pass",
    "relevance_threshold": 3,
    "coherence": 2.0,
    "gpt_coherence": 2.0,
    "coherence_reason": "The RESPONSE provides some relevant information but lacks a clear and logical structure, making it difficult to follow. It does not directly answer the question in a coherent manner, which is why it falls into the \"Poorly Coherent Response\" category.",
    "coherence_result": "fail",
    "coherence_threshold": 3,
    "groundedness": 3.0,
    "gpt_groundedness": 3.0,
    "groundedness_reason": "The response attempts to answer the query about Marie Curie's birthplace but includes incorrect information by stating she was not born in Paris, which is irrelevant. It does provide the correct birthplace (Warsaw), but the misleading nature of the response affects its overall groundedness. Therefore, it deserves a score of 3.",
    "groundedness_result": "pass",
    "groundedness_threshold": 3
}