我想结合supervised_embeddings来测试SpacyNLP管道。但是,如果我尝试启动它,我会得到这个堆栈跟踪。如果在config.yml中,我只保留supervised_embeddings,则不会发生这种情况。但是,如果我试图只离开SpacyNLP管道,我会得到这个错误:
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.config.yml文件
# https://rasa.com/docs/rasa/nlu/components/
language: it_core_news_sm
pipeline:
- name: supervised_embeddings
- name: SpacyNLP
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MemoizationPolicy
- name: KerasPolicy
- name: MappingPolicy发布于 2019-06-19 04:10:59
我认为您混淆了preconfigured pipelines (这些是预定义的模板)和实际的NLU components。
如果您使用的是预配置的,则为:
pipeline: supervised_embeddings这与(某种快捷方式)相同
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"https://stackoverflow.com/questions/56381425
复制相似问题