首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到'supervised_embeddings‘的组件类。未知组件名称

找不到'supervised_embeddings‘的组件类。未知组件名称
EN

Stack Overflow用户
提问于 2019-05-30 23:41:45
回答 1查看 1.4K关注 0票数 0

我想结合supervised_embeddings来测试SpacyNLP管道。但是,如果我尝试启动它,我会得到这个堆栈跟踪。如果在config.yml中,我只保留supervised_embeddings,则不会发生这种情况。但是,如果我试图只离开SpacyNLP管道,我会得到这个错误:

代码语言:javascript
复制
InvalidConfigError: No pipeline specified and unknown pipeline template 'SpacyNLP' passed. Known pipeline templates: pretrained_embeddings_spacy, keyword, supervised_embeddings

我是不是漏掉了什么?

代码语言:javascript
复制
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文件

代码语言:javascript
复制
# 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
EN

回答 1

Stack Overflow用户

发布于 2019-06-19 04:10:59

我认为您混淆了preconfigured pipelines (这些是预定义的模板)和实际的NLU components

如果您使用的是预配置的,则为:

代码语言:javascript
复制
pipeline: supervised_embeddings

这与(某种快捷方式)相同

代码语言:javascript
复制
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56381425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档