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

Rasa Core - Can not access action templateName, as that name is not a registered action for this domain

我正在 Python 3.6.7

中使用 Rasa NLURasa Core 构建我的第一个聊天机器人

一切正常。我在域文件的模板部分添加了一些新的话语,并写了一些故事来使用这些话语。现在 none 的新模板正在运行并且训练模型会产生以下错误:

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

我创建的新模板没有显示在这个列表中。 以下是我的模板的摘录:

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."

下面是我在故事文件中使用它们的方式:

* 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

我正在使用 Rasa Core version 0.10.1。谁能帮我解决这个问题?

注意 使用新模板删除故事将解决错误,训练将 运行 成功。所以我认为错误必须在故事文件或域文件中。

我真是太蠢了。 我没有在 domail.yml 文件的 actions 部分提到新模板。在 actions 部分下添加 utter_ask_email_send 解决了问题。也许现在我永远不会忘记。