Getting Error on training : ValueError: dictionary update sequence element #0 has length 1; 2 is required #1066
configuration file: { “pipeline”:“spacy_sklearn”, “path”:"./models/nlu", “data”:"./data/data.json" }
nlu_model.py
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 from rasa_nlu import config
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’)
def run_nlu(): interpreter = Interpreter.load(’./models/nlu/default/weathernlu’, RasaNLUConfig(‘config_spacy.json’)) print(interpreter.parse(“I am planning my holiday to Lithuania. I wonder what is the weather out there.”))
if name == ‘main’: train_nlu(’./data/data.json’, ‘config_spacy.json’, ‘./models/nlu’) #run_nlu()
Error:Traceback (most recent call last): File “nlu_model.py”, line 18, in train_nlu(’./data/data.json’, ‘config_spacy.json’, ‘./models/nlu’) File “nlu_model.py”, line 9, in train_nlu trainer = Trainer(RasaNLUModelConfig(config)) File “C:\anaconda3\lib\site-packages\rasa_nlu\config.py”, line 95, in init self.override(configuration_values) File “C:\anaconda3\lib\site-packages\rasa_nlu\config.py”, line 186, in override self.dict.update(config) ValueError: dictionary update sequence element #0 has length 1; 2 is required
How to resolve this error??