Git Product home page Git Product logo

Comments (6)

amn41 avatar amn41 commented on July 22, 2024

Hi @yogeshhk - we're using scikit-learn 0.18.1 - can you tell me exactly which line throws the importerror?

from rasa.

yogeshhk avatar yogeshhk commented on July 22, 2024

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\train.py", line 54, in do_train
File "build\bdist.win-amd64\egg\rasa_nlu\train.py", line 31, in create_trainer

File "build\bdist.win-amd64\egg\rasa_nlu\trainers\spacy_sklearn_trainer.py", line 8, in
File "build\bdist.win-amd64\egg\rasa_nlu\classifiers\sklearn_intent_classifier.py", line 1, in
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\model_selection_init_.py", line 1, in
from .split import BaseCrossValidator
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\model_selection_split.py", line 36, in
from ..gaussian_process.kernels import Kernel as GPKernel
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\gaussian_process_init
.py", line 13, in
from .gpr import GaussianProcessRegressor
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\gaussian_process\gpr.py", line 15, in
from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\gaussian_process\kernels.py", line 30, in
from ..metrics.pairwise import pairwise_kernels
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\metrics_init_.py", line 33, in
from . import cluster
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\metrics\cluster_init_.py", line 23, in
from .bicluster import consensus_score
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\metrics\cluster\bicluster_init_.py", line 1, in
from .bicluster_metrics import consensus_score
File "c:\users\kulkarni\appdata\local\enthought\canopy\user\lib\site-packages\sklearn\metrics\cluster\bicluster\bicluster_metrics.py", line 6, in
from sklearn.utils.validation import check_arrays
ImportError: cannot import name check_arrays

from rasa.

amn41 avatar amn41 commented on July 22, 2024

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.

from rasa.

yogeshhk avatar yogeshhk commented on July 22, 2024

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?

from rasa.

amn41 avatar amn41 commented on July 22, 2024

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

from rasa.

amn41 avatar amn41 commented on July 22, 2024

closing this now. If you are certain the HTTP request is valid & there's an issue on rasa's side, please re-open.

from rasa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.