Every time I call for RasaNLUInterpreter: nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
I do not remember the steps that led to that problem, but I know it was after installing Flask.
It is an error with Spacy, a library for the advanced processing of natural language in Python and Cython and that serves as a backend to RasaNLU.
pip install rasa_nlu[spacy]
python -m spacy download en_core_web_md
python -m spacy link en_core_web_md en
And the error message is:
(MoodEnv) mike@mike-thinks:~/Programing/Rasa/Moodbot$ python run_app.py
Traceback (most recent call last):
File "run_app.py", line 6, in <module>
nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/weathernlu')
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_core/interpreter.py", line 221, in __init__
self._load_interpreter()
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_core/interpreter.py", line 237, in _load_interpreter
self.interpreter = Interpreter.load(self.model_directory)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_nlu/model.py", line 276, in load
skip_validation)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_nlu/model.py", line 303, in create
model_metadata, **context)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_nlu/components.py", line 398, in load_component
cached_component, **context)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_nlu/registry.py", line 131, in load_component_by_name
return component_clz.load(model_dir, metadata, cached_component, **kwargs)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/rasa_nlu/utils/spacy_utils.py", line 126, in load
nlp = spacy.load(model_name, parser=False)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/__init__.py", line 15, in load
return util.load_model(name, **overrides)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/util.py", line 112, in load_model
return load_model_from_link(name, **overrides)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/util.py", line 129, in load_model_from_link
return cls.load(**overrides)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/data/en/__init__.py", line 12, in load
return load_model_from_init_py(__file__, **overrides)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/util.py", line 173, in load_model_from_init_py
return load_model_from_path(data_path, meta, **overrides)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/util.py", line 156, in load_model_from_path
return nlp.from_disk(model_path)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/language.py", line 653, in from_disk
util.from_disk(path, deserializers, exclude)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/util.py", line 511, in from_disk
reader(path / key)
File "/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/language.py", line 641, in <lambda>
self.vocab.from_disk(p) and _fix_pretrained_vectors_name(self))),
File "vocab.pyx", line 377, in spacy.vocab.Vocab.from_disk
File "/usr/lib/python3.5/pathlib.py", line 1151, in open
opener=self._opener)
File "/usr/lib/python3.5/pathlib.py", line 1005, in _opener
return self._accessor.open(self, flags, mode)
File "/usr/lib/python3.5/pathlib.py", line 371, in wrapped
return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mike/Programing/Rasa/Moodbot/MoodEnv/lib/python3.5/site-packages/spacy/data/en/en_core_web_md-2.0.0/vocab/lexemes.bin'
It seems that the problem was also found here but I do not understand the answer in English.
- Who asked the question proposes to use the "md" versions, which solved the problem, but it would be better if the "sm" versions would work too.
- Who created the library says that the problem is reduced to some symbolic links, and things overwrite in a way that we do not expect.
I really do not know what the first one meant, without knowing how to uninstall and without knowing who it was referring to, I reinstalled Spacy