[Evaluation] Normalize evaluator validation errors to EvaluationException with USER_ERROR blame#47735
Draft
m7md7sien wants to merge 1 commit into
Draft
Conversation
…R_ERROR blame Convert raw ValueError/TypeError input and configuration validation failures in ContentSafety, QA, Rouge, DocumentRetrieval and TaskNavigationEfficiency evaluators to EvaluationException, and ensure user-validation errors across the evaluator base consistently set blame=ErrorBlame.USER_ERROR with appropriate category/target. Adds QA/Rouge/DocumentRetrieval ErrorTarget enum members and updates the task navigation test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Normalizes evaluation/validation error handling in
azure-ai-evaluationso that user input and configuration errors are consistently raised asEvaluationExceptionwithblame=ErrorBlame.USER_ERROR(plus an appropriatecategoryandtarget).Previously several evaluators raised bare
ValueError/TypeErrorfor input/threshold validation, and a few existingEvaluationExceptionraises did not setblame, so they defaulted toUnknown/InternalErroreven though they were caused by user input.Changes
Raw
ValueError/TypeError→EvaluationException(USER_ERROR)ContentSafetyEvaluator— threshold type checkQAEvaluator— threshold type checkRougeScoreEvaluator— threshold type checkDocumentRetrievalEvaluator— ground-truth label and input-record validationmatching_modeandground_truthvalidationExisting
EvaluationExceptionmissingUSER_ERROR_base_eval.py) — conversation message mismatch, malformed tool-call parsing, and threshold-not-a-number checks now setblame=USER_ERROR(onecategory=UNKNOWNcorrected toINVALID_VALUE)Supporting
QA_EVALUATOR,ROUGE_EVALUATOR, andDOCUMENT_RETRIEVAL_EVALUATORmembers toErrorTargetEvaluationExceptionfor an invalidmatching_modeIntentionally left unchanged (not user errors)
SYSTEM_ERROR(malformed LLM output, not user input)._conversation_aggregators.pyUNKNOWN,_base_rai_svc_eval.py"Not implemented") are unchanged.Validation
black(pinned 24.4.0, repo config) passes on all modified files.