I am able to add new examples for existing intents and once the model is retrained it works fine. But when I add new intent time as shown
`intents:
greet
goodbye
thanks
deny
joke
name
time`
add new action as
`actions:
utter_name
utter_thanks
utter_greet
utter_goodbye
action_joke
action_time`
add new training examples in nlu_data.md as
`## intent:time
What is the time now?
Current time
`
add a new story
` ## story_time_01
time
action_time` (syntax is proper I checked)
and added a new action handler in actions.py as
`class ActionTime(Action):
def name(self):
# define the name of the action which can then be included in training stories
return âaction_timeâ
def run(self, dispatcher, tracker, domain):
# what your action should do
# resp = str(datetime.now())
dispatcher.utter_message("Hello world!") # send the message back to the user
return []`
and when I rebuild, retrain everything - the action server shows me that new action is registered but when interact with the bot by asking âCurrent timeâ or âWhat is the time now?â - it does not recognize and goes back to greeting. I tried adding few sequences to the story section but not working.
This sounds like an NLU issue. The bot is not correctly identifying the intent the user gives it.
Can you try running your Core + NLU run command with the debug (âdebug) flag to verify? Run it, ask âwhat is the time now?â and read what the NLU does. for me it looks like this:
If the NLU says it recognizes a different intent, try to update your NLU model to make it doubly sure of what you mean.
To test if itâs NOT an NLU issue you can try to directly feed the intent to the bot by using slash (â/â) and then the intent name (e.g. /what_is_the_time) if it doesnât recognize that command, thereâs either something wrong in your domain file (intent not added) or in your stories.
tried with the / and both of the texts generate the intent and I get a proper response. So I guess something wrong with the stories and not matching it. stories.md (821 Bytes)
nlu_data.md (2.6 KB)
domain.yml (450 Bytes)
Your input -> What is the time now?
2019-03-14 15:34:56 DEBUG rasa_core.tracker_store - Creating a new tracker for id âdefaultâ.
2019-03-14 15:34:56 DEBUG rasa_core.processor - Received user message âWhat is the time now?â with intent â{ânameâ: âgoodbyeâ, âconfidenceâ: 0.27236523003856555}â and entities â[]â
2019-03-14 15:34:56 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 2 events
2019-03-14 15:34:56 DEBUG rasa_core.processor - Current slot values:
name: None
2019-03-14 15:34:56 DEBUG rasa_core.policies.memoization - Current tracker state [None, {}, {âintent_goodbyeâ: 1.0, âprev_action_listenâ: 1.0}]
2019-03-14 15:34:56 DEBUG rasa_core.policies.memoization - There is a memorised next action â10â
2019-03-14 15:34:56 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_MemoizationPolicy
2019-03-14 15:34:56 DEBUG rasa_core.processor - Predicted next action âutter_goodbyeâ with prob 1.00.
2019-03-14 15:34:56 DEBUG rasa_core.processor - Action âutter_goodbyeâ ended with events â[]â
2019-03-14 15:34:56 DEBUG rasa_core.processor - Bot utterance âBotUttered(text: Talk to you later!, data: {
âelementsâ: null,
âbuttonsâ: null,
âattachmentâ: null
})â
Talk to you later!
2019-03-14 15:34:56 DEBUG rasa_core.policies.memoization - Current tracker state [{}, {âintent_goodbyeâ: 1.0, âprev_action_listenâ: 1.0}, {âprev_utter_goodbyeâ: 1.0, âintent_goodbyeâ: 1.0}]
2019-03-14 15:34:56 DEBUG rasa_core.policies.memoization - There is a memorised next action â0â
2019-03-14 15:34:56 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_MemoizationPolicy
2019-03-14 15:34:56 DEBUG rasa_core.processor - Predicted next action âaction_listenâ with prob 1.00.
2019-03-14 15:34:56 DEBUG rasa_core.processor - Action âaction_listenâ ended with events â[]â
127.0.0.1 - - [2019-03-14 15:34:56] âPOST /webhooks/rest/webhook?stream=true&token= HTTP/1.1â 200 186 0.217594
So this tells us your NLU classified âwhat is the time now?â with an intent called goodbye. Not that great
Since /time does generate the proper intent, we know that thereâs nothing wrong with the stories nor the domain. Weâll have to look at NLU.md as the culprit.
So, Iâve checked your NLU data file.
You have 2 examples for your time intent. Your model wonât be able to generalize from that. Think about it like this: Iâm going to teach you dutch. You can say thank you in dutch like this:
dankjewel
dank je wel
So now, if I say
danku!
what do I mean by that? It could mean dankjewel. It could also mean something way different Take a guess! Itâs what your model does.
So if I add more examples for you, how to say âdankjewelâ differently:
dank je
bedankt
dank je man
mijn dank
ik stel het op prijs
Now you will be able to generalize way better.
So: Please add about (at least) 6 more examples and retrain your NLU engine please. youâll see that itâll classify your intent way better.
haha! Good job! Please mark my previous post as âsolutionâ to make this thread usable for people with the same problem! You can find the solution button next to the heart below the post.