Python 找不到“受监督的_嵌入”的组件类。未知组件名称
我想测试SpacyNLP管道和受监督的_嵌入。如果我尝试启动它,我会得到这个堆栈跟踪。如果在config.yml中,我只保留受监督的_嵌入,则不会发生这种情况。 但是,如果我试图只保留SpacyNLP管道,则会出现以下错误:Python 找不到“受监督的_嵌入”的组件类。未知组件名称,python,chatbot,rasa-nlu,Python,Chatbot,Rasa Nlu,我想测试SpacyNLP管道和受监督的_嵌入。如果我尝试启动它,我会得到这个堆栈跟踪。如果在config.yml中,我只保留受监督的_嵌入,则不会发生这种情况。 但是,如果我试图只保留SpacyNLP管道,则会出现以下错误: InvalidConfigError: No pipeline specified and unknown pipeline template 'SpacyNLP' passed. Known pipeline templates: pretrained_embedding
InvalidConfigError: No pipeline specified and unknown pipeline template 'SpacyNLP' passed. Known pipeline templates: pretrained_embeddings_spacy, keyword, supervised_embeddings
有什么我遗漏的吗
KeyError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\rasa\nlu\registry.py in get_component_class(component_name)
140 try:
--> 141 return utils.class_from_module_path(component_name)
142 except Exception:
~\Anaconda3\lib\site-packages\rasa\nlu\utils\__init__.py in class_from_module_path(module_path)
143 else:
--> 144 return globals()[module_path]
145
KeyError: 'supervised_embeddings'
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
<ipython-input-109-971025f984ec> in <module>
8
9 # trainer to educate our pipeline
---> 10 trainer = Trainer(config.load("config.yml"))
11
12 # train the model!
~\Anaconda3\lib\site-packages\rasa\nlu\model.py in __init__(self, cfg, component_builder, skip_validation)
146 # required packages are available
147 if not self.skip_validation:
--> 148 components.validate_requirements(cfg.component_names)
149
150 # build pipeline
~\Anaconda3\lib\site-packages\rasa\nlu\components.py in validate_requirements(component_names)
34 failed_imports = set()
35 for component_name in component_names:
---> 36 component_class = registry.get_component_class(component_name)
37 failed_imports.update(
38 find_unavailable_packages(component_class.required_packages())
~\Anaconda3\lib\site-packages\rasa\nlu\registry.py in get_component_class(component_name)
148 "listed as part of the `component_classes` in "
149 "`rasa.nlu.registry.py` or is a proper name of a class "
--> 150 "in a module.".format(component_name)
151 )
152 else:
Exception: Failed to find component class for 'supervised_embeddings'. 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.
我认为您将这些预定义模板与实际模板混淆了 如果您使用的是预配置的,它将是:
pipeline: supervised_embeddings
哪一种捷径和
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"