Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Am I training my wit.ai bot correctly?

Tags:

wit.ai

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?
like image 338
Filipe Avatar asked Aug 06 '16 03:08

Filipe


People also ask

What is the use of wit AI?

Wit.ai is a natural language processing (NLP) tool that helps developers get structured data from chat or voice. Wit.ai makes it easy to build NLP into your chat bot, that learns from every interaction.

How do I get wit Ai access token?

Where is my Access Token? After creating your app, you can find your access token in the app's Settings tab.


2 Answers

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.

like image 189
Ravi Teja Avatar answered Sep 26 '22 13:09

Ravi Teja


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.

like image 39
Ali Zarezade Avatar answered Sep 26 '22 13:09

Ali Zarezade