A caller says, “Please check order zero four seven.” One transcript changes please to kindly. Another changes zero to one. Both have a word error rate of one in six. The first can still open order 047. The second can open order 147 and give the caller a perfectly fluent answer about somebody else's parcel.
To test spoken ID accuracy in voice agents, capture the exact string your application would send to its lookup tool. Compare it with the ID a listener heard, and give the test a way to say “the caller gave no usable ID.” The six-turn Python example below shows how two releases can complete the same number of correct lookups while making very different mistakes.
Define what counts as a correct lookup
Consider a returns assistant that asks for a six-digit order number. A caller says “zero zero four one seven two.” The expected lookup argument is the string "004172". Store it as an integer anywhere along the route and you end up with 4172. Padding that value back to six digits may hide the bug on this turn. It can also manufacture a plausible order number when the caller actually stops after four digits.
For this test, count a lookup when the application hands an argument to the order tool. A candidate in the model's scratch state has no effect on the score. A rejected lookup that reached the tool still counts as an attempt. That distinction matters when testing with a stub database. A wrong ID might return “no such order” in the test database and resolve to a real order in production.
Write the expected tool argument before you listen to either system's output. A model can agree perfectly with a reference its own formatter helped create.
Use one labeled opportunity per request for an ID. An answerable turn has a complete, unambiguous value. An unanswerable turn might contain a question about where to find the number, an abandoned attempt, or two possible readings with no clear correction. Label the desired outcome for that turn as no lookup. Keep a separate count for transport failures so a broken connection never earns credit for choosing to ask again.
Keep the transcript metric alongside the field metric
Word error rate (WER) counts insertions, deletions, and substitutions against a reference transcript, then divides by its word count. It can tell you that captions got harder to read. Whole-ID exact match answers the narrower question a support engineer gets after a bad lookup. In the opening example the word count and the number of edits stay fixed. Changing which word is wrong changes the outcome.
One developer evaluating call transcripts described cleaning up formatting differences and then finding that policy numbers still had incorrect digits. Researchers evaluating spoken identifiers have also used dedicated test sets with repeated characters, pauses, and hesitations. Those examples give you a reason to test your own capture flow. The rate you observe will depend on your callers, audio path, and field format. Practitioner's account · Interspeech identifier study
Build a fixture with a reason for each recording
Start with invented order numbers a teammate can read aloud. Write a short prompt like “You are calling about order 004172.” Let the speaker choose the phrasing. Someone may read the digits in pairs, use “oh” for zero, or stop to find their place. Have a second person transcribe the final intended value from the audio. If the speaker reads the card incorrectly, the recording and what the listener can establish determine the label. The original card alone cannot settle it.
| Turn | What the caller says | Expected lookup | What it exercises |
|---|---|---|---|
| A | “Zero zero four one seven two.” | 004172 |
Leading zeros |
| B | “Eight six six … six three one.” | 866631 |
A repeated digit across a pause |
| C | “Four two nine six eight five. Sorry, last digit three.” | 429683 |
A clear correction |
| D | “It's one eight four zero two nine.” | 184029 |
An ordinary successful turn |
| E | “The parcel had six items. Where is the order number?” | No lookup | An unrelated number |
| F | “It starts with zero four. Hang on, I lost the email.” | No lookup | An incomplete value |
A clean success belongs in a regression suite. Otherwise a policy that asks everyone to repeat themselves can look remarkably good. Keep the two no-lookup turns as well. If you test only callers who supply an ID, you never exercise the tempting path where the extractor fills in a missing field.
Give each recording a stable clip ID, a speaker group, and a field type. Keep the expected string in a separate label file. Use the same files for the baseline and candidate. A corpus of connected digits can broaden your acoustic tests, but listen to how it was recorded. TIDIGITS collected spoken sequences in a quiet enclosure. A support caller correcting the last digit over a phone line exercises additional parts of your application. TIDIGITS collection notes
Score two releases with a short Python replay
The table below the code uses synthetic tool traces. Each value is what a fake lookup tool received. An explicit None means the turn completed without a call. A missing dictionary key means the replay is incomplete. Treating both cases as an empty string would give a crashed worker the same score as a deliberate abstention.
Run this example with Python 3. It uses only the standard library. It assumes at most one lookup per turn. If your agent can call twice, record the full list and fail a separate assertion on multiple calls before converting it to this format. Keeping only the last call would erase an earlier wrong lookup.
from collections import Counter
expected = dict(A="004172", B="866631", C="429683",
D="184029", E=None, F=None)
baseline = dict(A="004172", B="866631", C="429685",
D=None, E="000006", F=None)
candidate = dict(A="004172", B=None, C="429683",
D=None, E=None, F=None)
def score(labels, calls):
if labels.keys() != calls.keys():
raise ValueError("Replay must cover exactly the labeled turns")
counts = Counter()
for clip, wanted in labels.items():
sent = calls[clip]
if wanted is None:
outcome = "held" if sent is None else "invented"
elif sent is None:
outcome = "missed"
else:
outcome = "exact" if sent == wanted else "wrong"
counts[outcome] += 1
return counts
for release in (baseline, candidate):
result = score(expected, release)
print([result[k] for k in ("exact", "wrong", "missed",
"invented", "held")])
| Outcome | Baseline | Candidate | Denominator |
|---|---|---|---|
| Exact lookup | 2/4 | 2/4 | Answerable turns |
| Wrong value sent | 1/4 | 0/4 | Answerable turns |
| No lookup on an answerable turn | 1/4 | 2/4 | Answerable turns |
| Value sent with no usable ID | 1/2 | 0/2 | Unanswerable turns |
| Held lookup on an unanswerable turn | 1/2 | 2/2 | Unanswerable turns |
Both builds achieve 50% whole-ID exact match on the four answerable turns. Read down the other rows. The candidate fixes the correction on C and stops guessing on E. It also loses a previously correct lookup on B. That single row is a good next debugging session. Play it and check which stage first drops or rejects the repeated six.
You can also divide incorrect attempts by all attempted lookups if the question is “how often did a caller who reached lookup get the wrong value?” Here the baseline sent four lookups and two were wrong, including the invented ID. The candidate sent two and both were correct. Report those attempt counts next to the fraction. Suppressing more calls can make this measure improve while more customers leave without an answer.
Find the first stage that changed the digits
For each failed clip, put the final recognition text, the extracted candidate, and the argument received by the tool stub side by side. A single clip viewed this way can rule out an expensive model swap. If the transcript says “zero zero four one seven two” and the extractor emits "004172", an integer in the outgoing request points straight to serialization.
| First unexpected observation | Smallest useful replay |
|---|---|
| The finalized text loses a repeated digit | Feed the saved audio through the same codec and chunk boundaries. Compare with a complete-file transcription. |
| The text contains the right words but the field loses a zero | Feed that text directly to the extractor. Inspect the type as well as the value it returns. |
| The candidate is correct but the tool receives an older value | Replay both the original phrase and correction. Record every attempted call in order. |
| The extractor finds an ID in an unrelated sentence | Replay a question containing another number. Check whether the field can be explicitly absent. |
Pin number formatting and segment handling in the SDK
A speech SDK may offer inverse text normalization, which renders spoken words in written form. For example, Deepgram exposes a numerals option that can render “nine hundred” as 900. Record the option, language, and model version in your replay manifest. If a setting changes the presentation from digit words to a joined string, test both representations against the same independently labeled value. Deepgram numerals reference
Streaming adds a second source of variation. Amazon Transcribe marks whether a result is partial. A completed segment can end at a pause in the middle of a number. Replay B with the pause intact and log which segments the assembler used. If the full recording produces six digits and the streaming path produces five, inspect the missing digit's boundary before changing your prompt. For a voice interface, deciding when to give the caller another moment is a separate design choice. Amazon Transcribe segment semantics · Voice agent turn-taking guide
A native audio model may call the tool directly and provide little intermediate text. You can still label the audio and capture the outgoing argument. Mark any unavailable intermediate stage as unobserved. A separate transcript generated after the call can help a human navigate a clip, but it cannot establish what the original model heard.
Capture the request at the tool boundary
Run the normal SDK adapter against a fake order service. Have the service save the parsed request body and return the same neutral response for every invented order. This lets the conversation finish while preserving the type and value the receiver saw. Give each attempt a clip ID at the start of playback. Joining two files by row number makes an innocent change in completion order look like a recognition failure.
To test the harness itself, swap two outputs, remove one completed turn, and replace a six-character string with an integer. The first change should move the affected answerable turns out of the exact column. The second should stop the replay with an error. The third should fail even when all six digits print the same on screen. Once these checks pass, try the difficult case where the SDK times out after the tool has already received the request. The run should retain that attempted lookup and surface the transport error separately. That gives the person investigating a failure enough evidence to distinguish a missing response from an agent that chose to hold the call.
Decide whether to ship the change
Write down what the service can tolerate before comparing builds. For a parcel status tool, the support team might choose to block release on any new wrong-record lookup in its fixed incident suite. It might accept a reprompt on a difficult turn if the caller can finish using a keypad. That second condition needs its own end-to-end check. A reprompt counter tells you how often the caller was interrupted. It says nothing about whether the next attempt worked.
Keep a paired list of clips that changed outcome. Split the list by caller or call session when investigating patterns. Ten repetitions by one person can reproduce a bug, yet tell you little about its frequency across callers. Use original recordings from held-out speakers, collected with permission, to estimate field performance. Keep repeated synthetic cases for checking code changes. Report sample size and the number of affected calls alongside any rate.
For the six examples here, I would keep the candidate in replay and investigate B before sending traffic. I would also give D to the team that owns the shared capture flow, since both releases miss an ordinary number. Neither decision needs an industry accuracy target. Each has an owner, a recording, and a concrete question to answer.
FAQ
How do I measure spoken ID accuracy if IDs can start with zero?
Keep reference values and tool arguments as strings throughout the test. Use the field's documented alphabet and length to check the schema. Then compare the entire string with the independent label. When a provider returns a numeric type, record that as a schema failure. Converting it back to text cannot tell you how many zeros the caller supplied.
Should I use digit error rate or exact match for voice agent number capture?
Use exact match for the lookup decision. Digit error rate measures how many digit edits separate two sequences and helps you investigate whether the problem is a dropped digit or a much larger mismatch. A single edit can invalidate the entire order number. Show both measures if you are changing the recognizer and need to understand its acoustic errors.
How should a test score a caller who changes the last digit?
Label the corrected value if listeners agree the correction is clear. Save the earlier value as a specific wrong argument to watch for. Inspect the call history as well as the final response. A lookup on the earlier number followed by a successful correction still exposed the application to a wrong-record read.
Can a database match validate an ID that the model heard?
It can establish that a record exists. Two distinct numbers can both exist, so a successful query provides no independent evidence about which number the caller said. Use the recorded audio and its label for scoring. In a production lookup, keep the normal checks that authorize a caller to see the selected order.
What should I measure when the caller provides no number?
Count how often the agent sends a value on those turns and show the number of such turns tested. Include plausible distractions such as quantities and street numbers. If the recording is entirely quiet, also check whether the recognizer invents text before the field extractor runs. That gives you a separate place to fix the mistake. Testing speech recognition on silence
Top comments (0)