Не удалось найти класс компонента для 'supervised_embeddings'. Неизвестное имя компонента - PullRequest
0 голосов
/ 30 мая 2019

Я бы хотел протестировать конвейер SpacyNLP в сочетании с supervised_embeddings. Однако, если я попытаюсь запустить его, я получу эту трассировку стека. Этого не происходит, если в 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

1 Ответ

1 голос
/ 18 июня 2019

Я думаю, вы путаете предварительно настроенные конвейеры (это предопределенные шаблоны) с действительными компонентами NLU .

Если вы используете предварительно сконфигурированный, это будет:

pipeline: supervised_embeddings

, что совпадает (вид ярлыка) с

pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "EmbeddingIntentClassifier"
...