2

Does anybody know if it is at all possible to capture missed utterances? I don't see the missed ones being logged into CloudWatch. I know that you can view them in the Lex Console after 24 hours, but I'm trying to capture them with data attached to them.

As of right now the console only gives you what the missed utterances is, how many times it was said, and when the last time it was said. I want the rest of the "Data" attached to these missed utterances; for example what customer said it.

Does anybody know if this is possible with AWS or the SDK(.NET) currently with a lambda or something like that?

845614720
  • 756
  • 1
  • 7
  • 22

1 Answers1

1

Missed slot inputs can be caught and logged in your Lambda.
I suggest using sessionAttributes to keep track of something like last_elicit and you can determine if that slot was not filled, then log the missed input from inputTranscript any way you want.

I often force the slot to be filled by what ever is in inputTranscript and then handle it myself, because I found that Lex sometimes ignores legitimate slot inputs.


Missed Intent inputs are handled by Lex and responded to automatically.

The only control you have in Lex with handling missed Intent inputs is to customize the responses. Go to your Lex Console, under the "Editor" Tab, look at the bottom left for "Error Handling",

enter image description here

Open that menu and you will see: enter image description here

Lex prepares one of these "Clarification Prompts" and returns that without passing anything to your Lambda Function.

That is why you cannot log any information about missed intent utterances with a basic set up of Lex. So here's a more complicated set up using two Lambda Functions:

enter image description here

This "Pre-Lex Lambda" acts as a Proxy between your users and your Lex bot. This means you do not use Lex's built in Channel settings, and you have to build your own integrations between your Channels and the "Pre-Lex Lambda".

Then you also need to use either PostContent or PostText to pass your user's input to your Lex bot.

After setting this up you will finally be able to catch the Lex response for one of the Clarification Prompts, and then log your own details about the missed intent input.


Helpful References:
AWS SDK for .NET
SDK .NET API Docs for Lex
SDK .NET API Docs for Lambda
Example setting up a Lambda using SDK(.NET)

Jay A. Little
  • 3,239
  • 2
  • 11
  • 32
  • 1
    Hi Jay, thanks for your answers. So to expand on what you’re saying I’m confused about what I would need to do exactly. I’m struggling to find a way to capture if the utterance is NOT on my list for that intent. Is that what you’re talking about with “last_elicit”? Also on your second part if I wanted to capture something that was said before going into Lex, like if I called an automated phone system and at the first prompt I said “hamburger” and wanted to capture that was NOT one of the options how would I go about that? Thank you again. – 845614720 Dec 10 '18 at 08:42
  • 1
    If you only want to catch the intent utterances, you can ignore the slot inputs. For catching intent utterances and how exactly to go about setting up a Proxy between the user Channel and your Lex bot depends on your set up. I know it can be done with Lambda and SDK(.NET), but I don't know the specifics, but I'll explain what I can and add references for where to find out more. – Jay A. Little Dec 10 '18 at 13:52
  • 1
    Basically I want to capture what happens before going into the lambda, i.e: when those "Error Handling" parts are triggered. I want to know more about that event, what the user said, etc. – 845614720 Dec 10 '18 at 14:01
  • 1
    Hopefully that explains what you want to understand and at least points you in the right direction. If you have more specific questions on how to do each part, I suggest posting a new question to find others with expertise in those areas. – Jay A. Little Dec 10 '18 at 14:58