Closed yogeshhk closed 7 years ago
Hi @yogeshhk - we're using scikit-learn 0.18.1 - can you tell me exactly which line throws the importerror?
Traceback (most recent call last):
File "C:\Users\kulkarni\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.6.2.3262.win-x86_64\lib\runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Users\kulkarni\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.6.2.3262.win-x86_64\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "build\bdist.win-amd64\egg\rasa_nlu\train.py", line 65, in
File "build\bdist.win-amd64\egg\rasa_nlu\trainers\spacy_sklearn_trainer.py", line 8, in
my best guess is there is something up with your installation. I'm not familiar with the canopy distribution, but my advice would be to do a fresh install, with scikit-learn 0.18.1.
Then open up a python interpreter, and run
from sklearn import model_selection
and see if that throws the same error.
Thanks for the suggestion. I removed the Canopy distribution. Installed Minicoda 2 and then compilation seems to be fine. I could train the model and added it to the config.json I ran the server by
python -m rasa_nlu.server -c config.json
Then fired the test command from another window:
curl -XPOST localhost:5000/parse -d '{"q":"I am looking for Chinese food"}' | python -mjson.tool
It said:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 35 0 0 100 35 0 149 --:--:-- --:--:-- --:--:-- 149 No JSON object could be decoded
I tried another test. In browser I pasted:
http://localhost:5000/parse?q=I am looking for Chinese food
It gave:
{"text": "I am looking for Chinese food", "intent": "restaurant_search", "entities": []}
I did not get the correct reply as:
{
"intent" : "restaurant_search",
"entities" : [
{
"start": 8,
"end": 15,
"value": "chinese",
"entity": "cuisine"
}
]
}
What could have gone wrong?
There was exception on server side. Traceback is:
Exception happened during processing of request from ('127.0.0.1', 49833) Traceback (most recent call last): File "C:\Users\kulkarni\Miniconda2\lib\SocketServer.py", line 290, in _handle_request_noblock self.process_request(request, client_address) File "C:\Users\kulkarni\Miniconda2\lib\SocketServer.py", line 318, in process_request self.finish_request(request, client_address) File "C:\Users\kulkarni\Miniconda2\lib\SocketServer.py", line 331, in finish_request self.RequestHandlerClass(request, client_address, self) File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 76, in
File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 160, in init File "C:\Users\kulkarni\Miniconda2\lib\SocketServer.py", line 652, in init self.handle() File "C:\Users\kulkarni\Miniconda2\lib\BaseHTTPServer.py", line 340, in handle self.handle_one_request() File "C:\Users\kulkarni\Miniconda2\lib\BaseHTTPServer.py", line 328, in handle_one_request method() File "build\bdist.win-amd64\egg\rasa_nlu\server.py", line 201, in do_POST File "C:\Users\kulkarni\Miniconda2\lib\json__init__.py", line 339, in loads return _default_decoder.decode(s) File "C:\Users\kulkarni\Miniconda2\lib\json\decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\kulkarni\Miniconda2\lib\json\decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded
My Model training_data.json does have entry like:
{
"text": "show me chinese restaurants",
"intent": "restaurant_search",
"entities": [
{
"start": 8,
"end": 15,
"value": "chinese",
"entity": "cuisine"
}
]
},
I thought it would pick up entities, but did not. Any clues?
The example data provided is really just a toy example to show how to use rasa, & doesn't provide enough examples for the spacy NER model to pick up chinese
as an entity. I'll add a comment about that to the docs :)
Regarding the issue with your curl POST, my best guess is that the windows version of cURL
doesn't automatically encode the json data for you. I would suggest doing the request with Postman or a similar API testing tool (or just the python requests package
closing this now. If you are certain the HTTP request is valid & there's an issue on rasa's side, please re-open.
I am doing restaurants tutorial mentioned at http://rasa-nlu.readthedocs.io/en/latest/tutorial.html#section-tutorial
Doing it spacy_sklearn way
Downloaded spacy and all the models
I had scikit-learn installed, which was 0.18
I had data/demo-rasa.json so mentioned it in the config.json and not demo-restaurants.json
When I fiired following command:
python -m rasa_nlu.train -c config.json
I got error:
Thinking that its a scikit version issue (ref: http://stackoverflow.com/questions/29596237/import-check-arrays-from-sklearn) I installed 0.17.1 which gave following error:
I am stuck now.. not sure what to do next...any hints?