The tutorial says "In your working directory, create a data folder, and copy this demo-rasa.json file there."
I have done this.
Then: "Create a file called config_spacy.json or config_mitie.json, depending on the pipeline selected, in your working directory which looks like this"
I have copied the config_spacy.json just as required (and put it in my working directory). The config_spacy.json provided is as follows:
{
"pipeline": "spacy_sklearn",
"path" : "./models",
"data" : "./data/examples/rasa/demo-rasa.json"
}
Now this appears to be designed for someone working directly in the cloned repository -- why was I instructed to create a data folder in my "working directory" when a data folder already exists in the repository -- with the data! Seems half the tutorial was written for someone working in a new project folder, and the other half assumes you're working directly within the cloned repository.
Then: "python -m rasa_nlu.train -c sample_configs/config_spacy.json" -- again, this is written for someone working directly in the cloned repository which doesn't seem to relate to the tutorial that earlier instructed me to create a /data folder that would already exist in this cloned repository.
Furthermore, this command failed even when used in the cloned repository -- no default model was used and I was given an error:
"Exception: Failed to load spacy language model for lang 'en'. Make sure you have downloaded the correct model (https://spacy.io/docs/usage/)."
The tutorial says nothing about downloading a model.
Also after downloading the default 'en' model (which the tutorial never told me was required) and getting the model to finish training and save, the server does not seem to persist or function in any way after completing training. I just get "INFO:__main__:Finished training".
Any requests to the server as instructed return:
curl: (7) Failed to connect to localhost port 5000: Connection refused
Sorry @Godrek which tutorial are you referring to, this one? http://rasa-nlu.readthedocs.io/en/latest/tutorial.html
Sorry for not specifying -- yes that is the one. (http://rasa-nlu.readthedocs.io/en/latest/tutorial.html)
I followed the installation instructions in the prior page as well (http://rasa-nlu.readthedocs.io/en/latest/installation.html) using pip to install all of the required libraries: rasa_nlu, spaCy, scikit-learn, scipy
python -m rasa_nlu.train -c sample_configs/config_spacy.json doesn't start a server, it just calls Rasa NLU from the python interpreter to train a new model and close. You may be interested in using Rasa NLU HTTP server.
Moreover you may be interested by the fact that there is a specific doc for the stable version of Rasa NLU (downloaded from pypi).
Except your error related to the spacy model not being installed, what is exactly your issue with the docs (why so much hatred in this issue title) ?
Per the docs here:
The recommended way to install rasa NLU is using pip:
Thus, the tutorial is written assuming that people did it this way. And if they downloaded from GitHub/bleeding edge then they are familiar enough with Rasa and how it works to adapt the tutorial accordingly.
Also per the docs here is where the spacy model would've gotten downloaded.
I'm the one who modified the command in this section of the tutorial so you have me to thank for the confusion. I had moved the configs to the sample_config directory and went around everywhere a config file was mentioned to add the sub-directory. But in this case it doesn't apply since the tutorial is written in the mindset of downloading from pip.
In the end though, I think what you're saying is that the docs: written to address both GitHub + pip + docker are confusing. And we should likely break them out more discretely.
I'll rename this issue and leave it open to see if someone wants to help make things clearer.
I'm sorry for the originally hostile title -- I was mildly frustrated.
Clearly I missed the line:
"python -m spacy download en" and that is my bad. I also missed the difference in the commands using rasa_nlu.train and rasa_nlu.server -- again my fault (the commands looked so similar because they use the same config, but I was just frustrated and in a hurry -- apologies)
If nobody gets around to making things clearer I'll try to step up and see if there is anything I can do after I finish getting everything working.
Sorry for the hostile title, thanks for the help
I'm pretty certain we've all experienced that frustration so no worries. Thanks for the offer to try and help, once you've used it for so long it's easy to overlook the initial startup problems.
Are you up and running now?
I did get it working, thanks.
How should I create the config_spacy.json file? I installed everything using pip. I am getting error upon running this
{
"pipeline": "spacy_sklearn",
"path" : "./models",
"data" : "./data/examples/rasa/demo-rasa.json"
}
could someone help please.
@Pari-singh What is the error you are getting? And what is the command you are using with the config_spacy.json file?
{
"error": "No model found with alias 'default'. Error: Failed to load model metadata. [Errno 2] No such file or directory: '/home/paridhi/./models/default/metadata.json'"
}
This is what I am getting upon running
$ curl -XPOST localhost:5000/parse -d '{"q":"I am looking for Chinese food"}' | python -mjson.tool
In the tutorial, it was asked to create a file config_spacy.json in the working directory.
I did that, but I diidnt get what path is, in the mentioned .json file because I dont have any .\model path in my system.
@Pari-singh did you install from GitHub or pip?
Also, did you train any data either via the /train endpoint or the command line python -m rasa_nlu.train -c sample_configs/config_spacy.json
@Pari-singh The trained model should be generated within the folder: /home/paridhi/./models/
The default folder name uses the timestamp. You can change the folder name to "default" so that make sure that there is one model as default.
Yes, got it running... yeah it was the default folder location which was causing the error...
Thanks @osswangxining and @wrathagom
How do you upload a model once it is trained and saved ??
This is not related to this issue, please create a separate issue for your question.