Thanks for the replies, sorry if it’s not clear.
I think you’re right that custom actions aka slot-filling is the way to go.
But ideally I was looking to avoid a custom action/python code
The problem is that a user’s name cannot really be defined in normal intent matching terms. If they say “My name is [xxxx]” maybe we can catch a pattern but not if they just say the name itself, Bob
. So I did try with a regex pattern
## regex:username
- [a-z]{3,}
ie anything with three+ letters should match
So given this regex
username entity, I was hoping to get a match on a path like this
## get_name
* greet
- utter_greet
- utter_ask_username
* give_username
- utter_thanks
- utter_goodbye
where the related intent is:
## intent:give_username
- my name is [alan](username)
- [bob](username)
However this matches all kinds of other intents.
If I type bob
it will match though…
Maybe my regex entity isn’t working
So it seems something else is taking priority in the matching.
Update: NLU check
I tried rasa shell nlu
to try and understand the matching a bit more.
3 letters matches well to username
abc
{
"intent": {
"name": "give_username",
"confidence": 0.15361180901527405
},
"entities": [],
"intent_ranking": [
{
"name": "give_username",
"confidence": 0.15361180901527405
},
five letters matches as an ‘affirm’ (based on standard rasa)
nancy
{
"intent": {
"name": "affirm",
"confidence": 0.16830478608608246
},
"entities": [],
"intent_ranking": [
{
"name": "affirm",
"confidence": 0.16830478608608246
},
{
"name": "give_username",
"confidence": 0.14397381246089935
},
using the phrase “my name is …” (part of the intent def) fails too
even 3 letters fails
my name is hot
{
"intent": {
"name": "myname",
"confidence": 0.4133380949497223
},
"entities": [],
"intent_ranking": [
my name is abcdef
{
"intent": {
"name": "affirm",
"confidence": 0.47324347496032715
},
"entities": [],
"intent_ranking": [
with the specific example in the training set we get a match
my name is bob
{
"intent": {
"name": "give_username",
"confidence": 0.5735953450202942
},
"entities": [
{
"start": 11,
"end": 14,
"value": "bob",
"entity": "username",
"confidence": 0.8531587364384371,
"extractor": "CRFEntityExtractor"
}
],
"intent_ranking": [
so it seem something about the way I defined the entity isn’t catching