“如何解决错误”;异常:未能找到'&书信电报;spacy.lang.pt.葡萄牙语对象“;在python的rasa_nlu中?

“如何解决错误”;异常:未能找到'&书信电报;spacy.lang.pt.葡萄牙语对象“;在python的rasa_nlu中?,python,nlp,rasa,Python,Nlp,Rasa,我正在Jupyter笔记本中使用rasa_nlu软件包启动葡萄牙语聊天机器人,运行代码时收到以下错误消息: Exception: Failed to find component class for '<spacy.lang.pt.Portuguese object at 0x000001D94243BE48>'. Unknown component name. Check your configured pipeline and make sure the mentioned co

我正在Jupyter笔记本中使用rasa_nlu软件包启动葡萄牙语聊天机器人,运行代码时收到以下错误消息:

Exception: Failed to find component class for '<spacy.lang.pt.Portuguese object at 0x000001D94243BE48>'. 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.
在上面的一行之后出现错误:

TypeError                                 Traceback (most recent call last)
~\anaconda3\lib\site-packages\rasa_nlu\registry.py in get_component_class(component_name)
    126         try:
--> 127             return utils.class_from_module_path(component_name)
    128         except Exception:

~\anaconda3\lib\site-packages\rasa_nlu\utils\__init__.py in class_from_module_path(module_path)
    121     # load the module, will raise ImportError if module cannot be loaded
--> 122     if "." in module_path:
    123         module_name, _, class_name = module_path.rpartition('.')

TypeError: argument of type 'Portuguese' is not iterable

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
<ipython-input-14-eee0bfaf3435> in <module>
----> 1 trainer = Trainer(config)

~\anaconda3\lib\site-packages\rasa_nlu\model.py in __init__(self, config, component_builder, skip_validation)
    124         # required packages are available
    125         if not self.skip_validation:
--> 126             components.validate_requirements(config.pipeline)
    127 
    128         # Transform the passed names of the pipeline components into classes

~\anaconda3\lib\site-packages\rasa_nlu\components.py in validate_requirements(component_names)
     54     failed_imports = set()
     55     for component_name in component_names:
---> 56         component_class = registry.get_component_class(component_name)
     57         failed_imports.update(find_unavailable_packages(
     58                 component_class.required_packages()))

~\anaconda3\lib\site-packages\rasa_nlu\registry.py in get_component_class(component_name)
    134                     "listed as part of the `component_classes` in "
    135                     "`rasa_nlu.registry.py` or is a proper name of a class "
--> 136                     "in a module.".format(component_name))
    137     return registered_components[component_name]
    138 

Exception: Failed to find component class for '<spacy.lang.pt.Portuguese object at 0x000001D94243BE48>'. 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.
TypeError回溯(最近一次调用)
get\u component\u类(组件名称)中的~\anaconda3\lib\site packages\rasa\u nlu\registry.py
126尝试:
-->127从模块路径(组件名称)返回utils.class
128例外情况除外:
~\anaconda3\lib\site packages\rasa\u nlu\utils\\uuuuu init\uuuuuuuu.py在类\u中来自模块路径(模块路径)
121#加载模块,如果无法加载模块,将引发ImportError
-->122如果模块路径中的“.”
123模块名称,类名称=模块路径.r分区('.')
TypeError:类型为“葡萄牙语”的参数不可编辑
在处理上述异常期间,发生了另一个异常:
异常回溯(最后一次最近调用)
在里面
---->1培训师=培训师(配置)
~\anaconda3\lib\site packages\rasa\u nlu\model.py in\uuuuuu init\uuuuuuuuu(self,config,component\u builder,跳过验证)
124#提供所需的软件包
125如果不是自校验,则跳过校验:
-->126.验证组件需求(配置管道)
127
128#将传递的管道组件名称转换为类
验证需求(组件名称)中的~\anaconda3\lib\site packages\rasa\u nlu\components.py
54失败的_导入=设置()
55对于组件名称中的组件名称:
--->56组件类=注册表。获取组件类(组件名称)
57导入失败。更新(查找不可用的包)(
58组件\u类。必需的\u包())
get\u component\u类(组件名称)中的~\anaconda3\lib\site packages\rasa\u nlu\registry.py
134“列为中的`组件类'的一部分”
135“`rasa_nlu.registry.py`or是类的专有名称”
-->136“在模块中。”.格式(组件名称))
137返回已注册的组件[组件名称]
138
异常:未能找到“”的组件类。未知组件名称。检查配置的管道,确保所述组件没有拼写错误。如果您正在创建自己的组件,请确保它在“rasa_nlu.registry.py”中作为“component_classes”的一部分列出,或者是模块中类的正确名称。

已合并
rasa\u nlu
包。我担心您使用的API已被弃用

TypeError                                 Traceback (most recent call last)
~\anaconda3\lib\site-packages\rasa_nlu\registry.py in get_component_class(component_name)
    126         try:
--> 127             return utils.class_from_module_path(component_name)
    128         except Exception:

~\anaconda3\lib\site-packages\rasa_nlu\utils\__init__.py in class_from_module_path(module_path)
    121     # load the module, will raise ImportError if module cannot be loaded
--> 122     if "." in module_path:
    123         module_name, _, class_name = module_path.rpartition('.')

TypeError: argument of type 'Portuguese' is not iterable

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
<ipython-input-14-eee0bfaf3435> in <module>
----> 1 trainer = Trainer(config)

~\anaconda3\lib\site-packages\rasa_nlu\model.py in __init__(self, config, component_builder, skip_validation)
    124         # required packages are available
    125         if not self.skip_validation:
--> 126             components.validate_requirements(config.pipeline)
    127 
    128         # Transform the passed names of the pipeline components into classes

~\anaconda3\lib\site-packages\rasa_nlu\components.py in validate_requirements(component_names)
     54     failed_imports = set()
     55     for component_name in component_names:
---> 56         component_class = registry.get_component_class(component_name)
     57         failed_imports.update(find_unavailable_packages(
     58                 component_class.required_packages()))

~\anaconda3\lib\site-packages\rasa_nlu\registry.py in get_component_class(component_name)
    134                     "listed as part of the `component_classes` in "
    135                     "`rasa_nlu.registry.py` or is a proper name of a class "
--> 136                     "in a module.".format(component_name))
    137     return registered_components[component_name]
    138 

Exception: Failed to find component class for '<spacy.lang.pt.Portuguese object at 0x000001D94243BE48>'. 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.