7

I'm trying to train my Wit.ai bot in order to recognize the first name of someone. I'm not very sure if I well understand how the NLP works so I'll give you an example.

  1. I defined a lot of expressions like "My name is XXXX", "Everybody calls me XXXX"
  2. In the "Understanding" table I added an entity named "contact_name" and I add almost 50 keywords like "Michel, John, Mary...".
  3. I put the trait as "free-text" and "keywords".

I'm not sure if this process is correctly. So, I ask you:

  1. does it matter the context like "My name is..." for the NLP? I mean...will it help the bot to predict that after this expression probably a fist name will come on?
  2. is that right to add like 50 values to an entity or it's completly wrong?
  3. what do you suggest as a training process in order to get the first name of someone?
malioboro
  • 3,097
  • 4
  • 35
  • 55
Filipe
  • 149
  • 1
  • 7

2 Answers2

6

You have done it right by keeping the entity's search strategy as "free-text" and "Keywords". But Adding keywords examples to the entity doesn't make any sense because a person's name is not a keyword.

So, I would recommend a training strategy which is as follows:

  • Create various templates of the message like, "My name is XYZ", "I am XYZ", "This is XYZ" etc. (all possible introduction messages you could think of)
  • Remove all keywords and expressions for the entity you created and add these two keywords:
    1. "a b c d e f g h i j k l m n o p q r s t u v w x y z"
    2. "XYZ" (can give any name but maintain this name same for validating the templates)
  • In the 'Understanding' tab enter the messages and extract the name into the entity ("contact_name" in your case) and validate them
  • Similarly, validate all message templates keeping the name as "XYZ"
  • After you have done this for all templates your bot will be able to recognise any name in a given template of the message

The logic behind this is your entity is a free-text and keyword which means it first tries to match the keyword if not matched it tries to find the word in the same position of the templates. Keeping the name same for validations helps to train the bot with the templates and learn the position where the name will be usually found.

Hope this works. I have tried this and worked for me. I am not sure how bot trains in background. I recommend you to start a new app and do this exercise. Comment if there is any problem.

Ravi Teja
  • 377
  • 4
  • 15
2

wit.ai has a pre-trained entity extraction method called wit/contact, which

Captures free text that's either the name or a clear reference to a person, like "Paul", "Paul Smith", "my husband", "the dentist".

It works good even without any training data. To read about the method refer to duckling.

Ali Zarezade
  • 871
  • 9
  • 22