Extend key entities metric to audio-native models#180
Draft
weiz9 wants to merge 1 commit into
Draft
Conversation
Extend transcription_accuracy_key_entities to support S2S / AUDIO_LLM pipelines. Audio-native models expose no reliable STT transcript, so the agent's tool-call arguments (from conversation_trace) become the evidence of what it understood: if the user says "my id is EM123" and the agent calls a tool with "EMP124", the entity is flagged as misheard. The metric now branches on pipeline type: - CASCADE: compares intended vs transcribed user turns (unchanged). - Audio-native: compares intended user entities vs tool-call arguments, using a new audio_native_prompt judge template. Bumps the metric to v0.4, metrics_version to 2.3.0, and regenerates the metric signature fixture.
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.
What
Extends the existing
transcription_accuracy_key_entitiesmetric to support audio-native pipelines (S2S / AUDIO_LLM). It stays a single text-to-text judge — no new metric class.Previously the metric was CASCADE-only: it compared what the user was instructed to say (
intended_user_turns) against what the agent's STT transcribed (transcribed_user_turns). Audio-native models expose no reliable STT transcript, so there was nothing to compare against.How
The metric now branches on pipeline type:
intended_user_turnsvstranscribed_user_turns(STT output) — transcription accuracy.conversation_trace), which are the evidence of what the model actually understood. If the user says "my id is EM123" and the agent calls a tool with "EMP124", the entity is flagged as misheard.Both paths reuse the same per-entity ratio scoring (
correct / total) and per-entity-type sub-metrics. Audio-native uses a newaudio_native_promptjudge template; the cascadeuser_promptis untouched.Changes
transcription_accuracy_key_entities.py: removed the CASCADE-only restriction (now all pipeline types), added_build_prompt_and_turns()to select source + prompt viacontext.is_audio_native, plus_get_audio_native_turns()/_format_intended_user_turns(). Bumped metricversionv0.3 → v0.4.configs/prompts/judge.yaml: addedaudio_native_promptunder the same metric key.TestPipelineSupportandTestAudioNativeCompute(misheard → 0, correct → 1, verifies the audio-native prompt is used with tool-call evidence).metrics_version2.2.0 → 2.3.0 and regeneratedmetric_signatures.json.Verification
Notes
judge.{name}.user_prompt, so future text edits to the newaudio_native_promptwon't auto-trip the drift test — they'd need a manual version bump. Happy to extendsignatures.pyto hash all prompt keys if preferred.strict) are unchanged; the new code adds none.