Skip to main content

Unrecognized speech

When the bot works in the telephone channel, all requests are handled by the automatic speech recognition service and converted to their text representation before they can be processed in the script.

The script must account for situations when speech recognition fails. If nothing in the request from the customer can be recognized for 5 seconds, or it contains no speech input at all, a speechNotRecognized event gets triggered.

Processing this event can be useful if:

Request clarification

When the request is unintelligible, the bot may ask to repeat it.

state: NoInput
event!: speechNotRecognized
a: I’m sorry, I didn’t catch that. Could you repeat, please?
a: I didn’t quite get it. Would you mind repeating that for me?
a: Could you say that again? I can’t hear you very well.

Answering machine

During call campaigns, there is always a chance that an answering machine will answer the call instead of the customer. These ineffective calls still spend the available call minutes.

It is advisable to impose a limit on unrecognized requests per session, so the bot can finish the call when the limit is exceeded.
state: NoInput || noContext = true
event!: speechNotRecognized
$session.noInputCounter = $session.noInputCounter || 0;
if: $session.noInputCounter >= 3
a: I’m sorry, there’s something wrong with the connection.
a: I didn’t catch that. Could you repeat, please?

Timeout setup

Sometimes the customer says several phrases with long pauses between them or takes a long time to formulate an answer to a complex question. The bot will wait for the customer to finish talking if you implement active listening in the script using the $dialer.setNoInputTimeout method:

state: Start
q!: $regex</start>
a: Hello, this is a delivery service. You’ve left a complaint about the quality of our delivery service. Could you please describe the situation in detail?
script: $dialer.setNoInputTimeout(10000); // The bot waits 10 seconds for an answer.

state: Answer
q: *
a: Yes.
$session.answer = $session.answer ? $session.answer + " " + $request.query : $request.query;
$dialer.setNoInputTimeout(2000); // The bot waits 2 seconds for an answer.
bargeIn: "phrase",
bargeInTrigger: "final",
noInterruptTime: 0

state: EndCall
event: speechNotRecognized
a: Okay, I wrote it all down. I’ve added that information to your request. We will contact you shortly to resolve this situation. Have a good day.
log("Full client response: " + $session.answer);

state: NoAnswer || noContext = true
event!: speechNotRecognized
a: Could you repeat that?

You can use this timeout when the customer asks the bot to wait:

state: Identification
q!: $regexp</start>
a: Mr. Smith, is that you?

state: Yes
q: (yes/(that/this/it) (is/'s) (I/me)) *
go!: /FirstQuestion

state: OneMoment || modal = true
q: * (wait*/[~one] (minute/second/moment)) *
q: * I'll (give/pass) {([to] him) ((the/my) phone)} *
q: * (wait/[one] (minute/second/moment)) * || fromState = .
a: Okay, thank you. I’m waiting.
$dialer.setNoInputTimeout(20000); // After a request to wait, the bot will wait up to 20 seconds for a response from the customer.

state: ClientIsHere
q: * (hello/yes/[I'm] here/listening) *
go!: /Identification

state: NoAnswer
event: speechNotRecognized
q: *
a: Hello? Are you there?

state: Silence
event: speechNotRecognized
a: I can’t hear you, I’ll call you back later.

state: FirstQuestion
a: We have a new promotion that runs for a whole month. Would you like to know about it?

state: CatchAll || noContext = true
event: noMatch
a: I don’t understand.