简体   繁体   English

Rasa Core - 无法访问操作templateName,因为该名称不是此域的注册操作

[英]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 NLURasa 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.

相关问题 rasa.core.processor-运行操作时遇到异常 - rasa.core.processor - Encountered an exception while running action RASA 无法运行自定义操作 - RASA Failed to run custom action Rasa Form Action - 插槽两次填充相同的数据 - Rasa Form Action - Slot getting filled with same data twice 使用 Z469A31FD9D773110F14057BAECCDDD25Z 的 Rasa 自定义操作服务器中未找到模块错误 - Module Not Found Error in Rasa Custom Action Server using DOCKER 可以异步触发操作的定期python线程 - Periodic python thread that can be asynchronously poked into action Python github复合操作返回名称未定义错误 - Python github composite action returns name not defined error rasa 导入错误:无法导入名称 &#39;InvalidSignatureError - rasa ImportError: cannot import name 'InvalidSignatureError 无法训练RASA-CORE模型投掷回溯:来自google.protobuf.pyext import _message ImportError:DLL加载失败:访问被拒绝 - Unable to train RASA-CORE Model throwing traceback :from google.protobuf.pyext import _message ImportError: DLL load failed: Access is denied Kivy MDToolBar right_action_items:无法更改屏幕 - Kivy MDToolBar right_action_items: Can't change Screens KivyMD Toolbar left_action_items 无法切换屏幕? - KivyMD Toolbar left_action_items can't switch screens?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM