Permission denied error while using pycrfsuite in rasa_nlu
See original GitHub issueHello,
I am trying to execute the below commands as given in http://rasa-nlu.readthedocs.io/en/latest/python.html but getting an error as permission denied as shown below:
`>>> trainer.train(training_data) Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “C:\Users\shuvayan.das\AppData\Local\Continuum\Anaconda3.3\lib\site-packa ges\rasa_nlu\model.py”, line 157, in train updates = component.train(*args) File “C:\Users\shuvayan.das\AppData\Local\Continuum\Anaconda3.3\lib\site-packa ges\rasa_nlu\extractors\crf_entity_extractor.py”, line 80, in train self._train_model(dataset) File “C:\Users\shuvayan.das\AppData\Local\Continuum\Anaconda3.3\lib\site-packa ges\rasa_nlu\extractors\crf_entity_extractor.py”, line 308, in _train_model self.ent_tagger.open(self.crf_file.name) File “pycrfsuite/_pycrfsuite.pyx”, line 571, in pycrfsuite._pycrfsuite.Tagger. open (pycrfsuite/_pycrfsuite.cpp:7731) File “pycrfsuite/_pycrfsuite.pyx”, line 717, in pycrfsuite._pycrfsuite.Tagger. _check_model (pycrfsuite/_pycrfsuite.cpp:10037) PermissionError: [Errno 13] Permission denied: ‘C:\Users\shuvayan.das\AppData \Local\Temp\tmpy84meugg’
`
Please help in resolving this. I am using windows here.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Hey,
I believe it is a bug in rasa-nlu library - it uses NamedTemporaryFIle, and this may cause problems on Windows - see http://stackoverflow.com/questions/18903069/how-can-i-read-namedtemporaryfile-in-python. This can’t be fixed in python-crfsuite; python-crfsuite just tries to save a file to a specified path, or open a file at a specified path; it is up to the caller to make sure destination is writable or readable.
I suggest to open an issue at rasa-nlu bug tracker. Instead of managing these temporary files manually it may be easier to use https://github.com/TeamHG-Memex/sklearn-crfsuite which handles temporary files automatically; with sklearn-crfsuite pickle or joblib can be used for persistence.
No downsides. Well, maybe only that sklearn-crfsuite brings you a couple of new pure-python dependencies (python-tabulate, tqdm) which are installed automatically along with sklearn-crfsuite. scikit-learn itself is not required for the basic use.