首页 > 解决方案 > 在 domaim.yml 中将 use_entities 设置为 [ ] 时出现 Rasa 错误

问题描述

我希望某些意图没有任何实体,并且根据文档https://rasa.com/docs/rasa/domain#ignoring-entities-for-certain-intents尝试执行此操作时出现错误

domain.yml 文件

intents:
  - greet:
    use_entities: []
  - goodbye

我收到以下错误

/home/venv/lib/python3.8/site-packages/rasa/shared/utils/io.py:97: UserWarning: Loading domain from 'domain.yml' failed. Using empty domain. Error: 'In the `domain.yml` file, the intent 'greet' cannot have value of `<class 'NoneType'>`. If you have placed a ':' character after the intent's name without adding any additional parameters to this intent then you would need to remove the ':' character. Please see https://rasa.com/docs/rasa/domain for more information on how to correctly add `intents` in the `domain` and https://rasa.com/docs/rasa/domain#intents for examples on when to use the ':' character after an intent's name.'

标签: pythonrasa-nlurasarasa-core

解决方案


你只是缺少一个缩进:

intents:
  - greet:
      use_entities: []
  - goodbye

推荐阅读