【发布时间】:2019-07-22 07:32:27
【问题描述】:
我正在尝试在 Rasa 中添加自定义组件。 在尝试训练模型时编写自定义组件后,出现以下错误:
ModuleNotFoundError: No module named 'RasaCustomPy'
和
Exception: Failed to find component class for 'RasaCustomPy.my_module.MyCustomComponent'. Unknown component name. Check your configured pipeline and make sure the mentioned component is not misspelled. If you are creating your own component, make sure it is either listed as part of the `component_classes` in `rasa.nlu.registry.py` or is a proper name of a class in a module.
我的项目结构如下:
RasaCustomPy
|
|---__init__.py
|
|---actions.py
|
|---my_module.py
|
|---data
|
|---venv
|
|---config.yml
|
|---credentials.yml
|
|---domain.yml
|
|---endpoints.yml
在config.yml 中,我尝试按如下方式添加我的自定义组件:
pipeline:
- name: RasaCustomPy.my_module.MyCustomComponent
所有 Rasa 依赖包都安装在 venv 文件夹中。
当我在激活我的 virtualenv 后尝试使用命令rasa train 训练它时出现错误。我正在使用 Rasa 1.0.7。
我是 Rasa 的新手,如有任何帮助,我们将不胜感激。
【问题讨论】: