In my project I need to extract the user’s name from user text and set the value to slot which type is text. Now the issue is for extracting varieties kinds of name I have to give a huge amount of training example under that particular intent, which is around 40000. And now it is breaking my stories flow. Is there any way to optimize this training data and solve this issue?
It will be a great help if any one can answer. Thanks in advance.
It can @chowdhuryshakur , Have all the possible combinations that can occur in your nlu.yml
Which means
- intent: user_name
examples: |
- my name is [John Doe]{"entity": "name"}
- You can call me [IronMan]{"entity": "name"}
- [Rahul]{"entity": "name"}
The reason why i asked you to not add only single word training data as your training data only had the names. The above way can handle single as well as name coming in sentence as well
- intent: tell_name
examples: |
- My name is [Justine Kuper]{"entity": "name"}.
- I am [John]{"entity": "name"}.
- I am [Anaz Abdul Karim]{"entity": "name"}.
- [Jack]{"entity": "name"}.
- [Borhan]{"entity": "name"}.
But when I am writing Anoop, it couldn’t extract the name.
My issue is not that much straight forward. Here I have a intent tell_name. From this I have to extract any kinds of name given by user. I tried to train my model by giving 40000+ examples under tell_name intent. After that my model was able to extract most of the name but my other story flows were broken.
Should I avoid this huge number of example under a single intent? Is there any way to extract human name (name from anywhere in the world)?
have you tried to add a standard entity value in your NLU training data?
- intent: tell_name
examples: |
- My name is [Justine Kuper]{"entity": "name", "value": "user_name"}.
- I am [John]{"entity": "name", "value": "user_name"}.
- I am [Anaz Abdul Karim]{"entity": "name", "value": "user_name"}.
- [Jack]{"entity": "name", "value": "user_name"}.
- [Borhan]{"entity": "name", "value": "user_name"}.
that will allow your NLU model extract name entity with synonym mapping, which avoid exploding your stories.
by doing that you won’t be able to get the real name directly from parsed message, as they are all mapped to “user_name”, but I guess you can still extract them with start/end index of extracted name entity.