범용 평가기 (클래식)

현재 보기:Foundry(클래식) 포털 버전 - 새 Foundry 포털의 버전으로 전환

Note

평가 및 Foundry 포털용 Microsoft Foundry SDK는 공개 미리 보기로 제공되지만 API는 일반적으로 모델 및 데이터 세트 평가에 사용할 수 있습니다(에이전트 평가는 공개 미리 보기로 유지됨). 이 문서에서 표시된 Azure AI 평가 SDK 및 평가자는 현재 모든 곳에서 공개 미리 보기로 제공됩니다.

AI 시스템은 일관성이 없거나 최소한의 문법적 정확성 이상의 일반적인 글쓰기 품질을 결여하는 텍스트 응답을 생성할 수 있습니다. 이러한 문제를 해결하기 위해 Microsoft Foundry는 일관성과 유창성 평가를 지원합니다.

만약 와 데이터가 모두 포함된 질문 답변(QA) 시나리오 contextresponseground truthquery 가 있다면, 관련 평가자를 활용해 판단을 내리는 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
IntentResolution, TaskAdherence, ToolCallAccuracy, ResponseCompleteness, Coherence, Fluency, SimilarityGroundedness, RetrievalRelevance 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 score

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
}