Resolve the Error ValueError: dictionary update sequence element #0 has length 1; 2 is required

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??

Hey @nikamsau. I can see you are using my old weatherbot example. So great to see that! :slight_smile:

I am pretty sure the example needs to be updated for the latest version of Rasa. I’ll do that later today, but in a meantime I would suggest you checking out the tutorial on Rasa documentation for a step-by-step intro to Rasa.

1 Like

Thanks @Juste for the response. I will surely go through the tutorial. But kindly provide the updated example, so that I can progress easily. Thanks!!

@Juste… Can you please confirm if you have changed the code for the weatherbot example