上一篇文章已经介绍了如何训练问答机器人,然而当训练语料为中文时不再可行。解决方法:在config.yml中加入下面几行后尝试训练。
- name: JiebaTokenizer
- name: CRFEntityExtractor
- name: CountVectorsFeaturizer
OOV_token: oov
token_pattern: '(?u)\b\w+\b'
- name: EmbeddingIntentClassifier
然而运行后会报错,错误如下:
ComponentNotFoundException: Failed to load the component 'EmbeddingIntentClassifier'. Cannot find class 'EmbeddingIntentClassifier' in global namespace. Please check that there is no typo in the class name and that you have imported the class into the global namespace. Either your pipeline configuration contains an error or the module you are trying to import is broken (e.g. the module is trying to import a package that is not installed). Traceback (most recent call last):
File "d:\programs\python\python38\lib\site-packages\rasa\nlu\registry.py", line 121, in get_component_class
return rasa.shared.utils.common.class_from_modul