[英]Rasa Core - Can not access action templateName, as that name is not a registered action for this domain
I am building my first chat bot using Rasa NLU
and Rasa Core
in Python 3.6.7
我正在使用
Python 3.6.7
Rasa NLU
和Rasa Core
构建我的第一个聊天机器人
Everything was working well. 一切都运作良好。 I added few new utterances in the templates section of the domain file and wrote some stories to use these utterances.
我在域文件的模板部分添加了一些新的话语,并写了一些故事来使用这些话语。 Now none of the new template is working and training the model produces the following error:
现在没有新模板正常工作,训练模型会产生以下错误:
File "dialogue_management_model.py", line 46, in <module>
train_dialogue()
File "dialogue_management_model.py", line 31, in train_dialogue
augmentation_factor = 50)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/agent.py", line 268, in train
**kwargs)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/ensemble.py", line 72, in train
policy.train(training_trackers, domain, **kwargs)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/memoization.py", line 152, in train
self._add(trackers_as_states, trackers_as_actions, domain)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/policies/memoization.py", line 108, in _add
feature_item = domain.index_for_action(action)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/domain.py", line 151, in index_for_action
self._raise_action_not_found_exception(action_name)
File "/home/pprasai/anaconda3/envs/nluenv/lib/python3.6/site-packages/rasa_core/domain.py", line 159, in _raise_action_not_found_exception
"Available actions are: \n{}".format(action_name, actions))
Exception: Can not access action 'utter_ask_email_send', as that name is not a registered action for this domain. Available actions are:
- action_check_ao
- action_default_fallback
- action_listen
- action_restart
- action_restaurant
- action_send_mail
- utter_ask_budget
- utter_ask_cuisine
- utter_ask_howcanhelp
- utter_ask_location
- utter_default
- utter_goodbye
- utter_greet
- utter_unsupported_city
The new templates I created are not shown in this list. 我创建的新模板未显示在此列表中。 Following is an excerpt of my templates:
以下是我的模板的摘录:
templates:
utter_sending_email:
- "An email is being sent."
utter_ask_email_send:
- "Would you like me to send you an email with details?"
utter_ask_email_address:
- "Could you please tell me your email address?"
utter_invalid_email:
- "It seems you might have entered an invalid email. Would you like to try again?"
utter_greet:
- "hey there! How may i help you"
- "Hi, How can I help you!"
- "Hey, How is it going. How May I help you Today"
utter_goodbye:
- "goodbye :("
- "Bye-bye"
utter_default:
- "I could not process you last query. I am terribly sorry."
And here's how I use these in the stories file: 以下是我在故事文件中使用这些内容的方法:
* greet
- utter_greet
* restaurant_search
- utter_ask_location
* restaurant_search{"location": "tokyo", "cuisine": "chinese"}
- slot{"location": "tokyo"}
- slot{"cuisine": "chinese"}
- utter_ask_budget
* restaurant_search{"budget": "economy"}
- slot{"budget": "ecnnomy"}
- action_search_restaurant
- utter_ask_email_send
* small_talk
- utter_sending_email
- utter_invalid_email
* deny
- utter_goodbye
I am using Rasa Core version 0.10.1
. 我使用的是
Rasa Core version 0.10.1
。 Can anyone kindly help me figure this out? 任何人都可以帮我解决这个问题吗?
NOTE Removing stories with the new templates will resolve the error and the training will run successfully. 注意使用新模板删除故事将解决错误,并且培训将成功运行。 So I think the error must be in either stories file or the domain file.
所以我认为错误必须在故事文件或域文件中。
It was very stupid of me. 这对我来说非常愚蠢。 I did not mention the new templates under
actions
section of my domail.yml
file. 我没有在
domail.yml
文件的actions
部分下提到新模板。 Adding utter_ask_email_send
under actions
section solved the problem. 在
actions
部分下添加utter_ask_email_send
解决了这个问题。 Perhaps now I'll never forget. 也许现在我永远不会忘记。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.