这是我编写的python(3.6.5):
from rasa_nlu.training_data import load_data
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.model import Trainer
from rasa_nlu.model import Metadata, Interpreter
def train_nlu(data, config, model_dir):
training_data = load_data(data)
trainer = Trainer(RasaNLUModelConfig(config))
trainer.train(training_data)
model_directory = trainer.persist(model_dir, fixed_model_name ='weathernlu')
if __name__ == '__main__':
train_nlu('./data/data.json', 'config_spacy.yml', './models/nlu')
我收到以下错误:
文件:C:\ Users \ bills \ AppData \ Local \ Programs \ Python \ Python36 \ Lib \ site-packages \ rasa_nlu \ config.py, 第95行,in__init__ self.override(configuraion_values)
文件:C:\ Users \ bills \ AppData \ Local \ Programs \ Python \ Python36 \ Lib \ site-packages \ rasa_nlu \ config.py, 第186行,覆盖自我。 dict .update(config)ValueError: 字典更新序列元素#0的长度为1;需要2个
我的配置文件如下:
config_spacy.yml:
{
"pipeline":"spacy_sklearn",
"path":"./models/nlu",
"data":"./data/data.json"
}