detect user´s name on sentence


(Felipe Marquardt) #1

I´m fresh on Kore and I´m trying to learn from the beginning.

First, I´m trying to ask for the user name and reply with “Hello {{context.entities.nome}}, how can I help you?”

But I´m havving trouble trying to detect the user´s name from sentence like “My name is Frank”.

The answer is showing: "Hello my name is frank, how can i help you?

I imagine that the dialago flow is not correct or setting the entity is on the wrong format? I´m using Person name Entity for the question.


(Yoga Ramya Mendu) #2

Hi @felipe,

We have checked the same scenario at our end.
Kindly refer the below example where we would be asking the user for name and printing the same name in a message node.

1- Create an entity node with type “Person Name”. (This type would automatically detect the name from a sentence and stores only name as the entity value)
name1

2-In the message node, add the prompt message as
your name is {{context.entities.EntityName}}
name2

3- The response from the bot
name3

Let us know if you need any further clarification on the above.

Regards,
Yoga Ramya.


(Felipe Marquardt) #3

Thank you very much @yogaramya.mendu
All my nodes ant setup was the same as yours. Only one thing was different, and that was the Bot´s Language.

I changed it to English and it worked. Can´t I use the bot in Portuguese and make it work the same way?


(Yoga Ramya Mendu) #4

Hi @felipe,

We have enabled the “Portuguese” language from Settings >> Language management of the bot.
Then, opened the chat window to test the entity.
We could observe that the bot is able to pick only name from the response given in Portuguese.

Kindly refer the attached screenshots.
name4

If you are still facing the issue, please send us the screenshots for further debugging.

Regards,
Yoga Ramya.


(Felipe Marquardt) #5

Sorry
when creating a new bot in Portuguese as default language, the detection of Person Name seens to not work correctly.
Does it only work when English is enabled?


(Felipe Marquardt) #6

thank you @yogaramya.mendu but I´m still having trouble to make work things that I imagine, are basic.
The bot
On the screenshot you see that I made two tests:

The first test: meu nome é Felipe
Bot says: Olá Felipe, em que posso ajudar? (this answer is ok)

on the second test I reply: meu nome é Márcio (my name is Márcio)
The bot says: Olá Meu, em que posso ajudar? (Hello My, how may I help you?)

meu%20nome

I cannot understand what may be causing this since both names are very tipical in portguese.
this also happens with other names, like Marcele, Zento…


Capitalize Entity information
(Yoga Ramya Mendu) #7

Hi Felipe,

We have discussed this issue with our engineering team.
This is a bug from our end where few specific names in any language are not recognized.
We have raised a ticket for the same, this issue would be addressed in further release.

Regards,
Yoga Ramya.


(Felipe Marquardt) #8

Sometimes the user replies as:

  • Hello, here is John from Company X.

The Person Name entity is showing: John from Company X.

tried to get only the first word with this JS but didn´t work. Is there another way?

var lower = context.entities.AskForName;


var firstWords = [lower];
for (var i=0;i<codelines.length;i++)
{
  var codeLine = codelines[i];
  var firstWord = codeLine.substr(0, codeLine.indexOf(" "));
  firstWords.push(firstWord);
}

var upper = firstWord.charAt(0).toUpperCase() + firstWord.substr(1);

print('Hello'+ upper + ', how can we help you today?');

(Yoga Ramya Mendu) #9

Hi @felipe,

We have checked with the same Utterance and the name John is appropriately detected by the Entity node with Type “Person Name”. Please refer the screenshots:

entity

Regards,
Yoga Ramya.