2

I have a AWS Lex chat bot and in which chat bot when asks name of customer, if customer enters only his name then no issue but what if customer enters "my name is sudhir" or "am sagar" or "this is hari".

How to filter name from above response in python code ?

I tried using modules like SpellChecker,nltk & Spacy nothing worked to handle this.

Please help if any one done already.

sepp2k
  • 363,768
  • 54
  • 674
  • 675
sudhir tataraju
  • 1,159
  • 1
  • 14
  • 30
  • 1
    In your Lex console, you will build your utterances to accommodate, as an example I am {name} or my name is {name} or this is {name} and name will be a slot you can try to associate an AMAZON.US_FIRST_NAME corpus to (no current support for IN and the returned value would be the slot name. – Chuck LaPress Mar 14 '19 at 21:15
  • @ChuckLaPress I would expand on your comment, format the example utterances, maybe add a screenshot of the Lex console for where to add the utterances and submit that as the answer. Lex handles this very well, so there should be no need to parse it much further in python. – Jay A. Little Mar 15 '19 at 03:42
  • i just gave an example , in the end we won't be having any idea what user gonna answer for each question, so i was seeking such kind of solution as per u guys i need to specify all the answers we may get from end user. which is not so easy – sudhir tataraju Mar 15 '19 at 04:26
  • @sudhirtataraju It is probably easier than you think. It should only take 5-10 minutes to brainstorm all the natural ways someone might answer, and type those into a list of utterances. Lex is built to take those utterances as a guide, not a strict format to match. So training Lex with many examples is key to capturing more accurate slot values. If you ignore this and do all the input parsing youself, you might as well build a chatbot from scratch because you are ignoring the core strengths of Lex. – Jay A. Little Mar 15 '19 at 07:37

1 Answers1

0

While adding slots you have , near the prompt you have a setting pan, click that you have this:

enter image description here

Then add a corresponding utterance according to the image.

https://tutorials.botsfloor.com/say-hello-to-your-own-amazon-lex-chat-bot-9f22e7a0f9b0

Read full article there.

Thanks for your question.

Quantum Dreamer
  • 432
  • 1
  • 6
  • 17