Botpress Rasa Not able to train model


#1

Not able to train a model with Rasa.

Steps followed :

  1. Created project with botpress init.
  2. Changes the environment variables as mentioned in the documentation.
  3. Got rasa up and running.

However, I am getting the following error while trying to train a model:-

bad value(s) in fds_to_keep


#2

Hi @ngautam0

  1. Please, share your confiig/nlu.json with seted values.;
  2. Send which command you use for run Rasa server and rasa server config.

#3

Botpress

config/nlu.json

{
  "intentsDir": "./generated/intents",
  "entitiesDir": "./generated/entities",
  "provider": "rasa",
  "debugModeEnabled": false,
  "minimumConfidence": "0.3"
}

RASA

config.yaml

language : "en"
pipeline : "spacy_sklearn"

RASA Server start command

python -m rasa_nlu.server --path model -c config.yaml

Let me know if you need any more information


#4

try this: python -m rasa_nlu.server --path botpress -c config.yaml


#5

python -m rasa_nlu.server --path botpress -c config.yaml

same error with this as well :frowning_face:


#6

how are you running RASA_NLU? If in separate docker container, please share the log of the RASA node covering logs where error is being raised in Botpress.


#7

@Haythamamin

I have followed below steps for running RASA_NLU:-

  1. Create a virtualenv
  2. pip install rasa_nlu[spacy]
  3. python -m spacy download en_core_web_md
  4. python -m spacy link en_core_web_md en
  5. python -m rasa_nlu.server --path model -c config.yml

RASA LOGS

2018-09-28 11:08:08+0530 [-] Log opened.
2018-09-28 11:08:08+0530 [-] Site starting on 5000
2018-09-28 11:08:08+0530 [-] Starting factory <twisted.web.server.Site object at 0x7fa72beebe10>
2018-09-28 11:08:16+0530 [-] "127.0.0.1" - - [28/Sep/2018:05:38:15 +0000] "GET /status HTTP/1.1" 200 294 "-" "axios/0.17.1"
2018-09-28 11:08:20+0530 [-] "127.0.0.1" - - [28/Sep/2018:05:38:19 +0000] "GET /status HTTP/1.1" 200 294 "-" "axios/0.17.1"
2018-09-28 11:08:20+0530 [-] 2018-09-28 11:08:20 ERROR    rasa_nlu.train  - Failed to train project 'dev__botpress__all'.
2018-09-28 11:08:20+0530 [-] Traceback (most recent call last):
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/rasa_nlu/train.py", line 125, in do_train_in_worker
2018-09-28 11:08:20+0530 [-]     component_builder)
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/rasa_nlu/train.py", line 148, in do_train
2018-09-28 11:08:20+0530 [-]     trainer = Trainer(cfg, component_builder)
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/rasa_nlu/model.py", line 152, in __init__
2018-09-28 11:08:20+0530 [-]     components.validate_requirements(cfg.component_names)
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/rasa_nlu/components.py", line 56, in validate_requirements
2018-09-28 11:08:20+0530 [-]     component_class.required_packages()))
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/rasa_nlu/components.py", line 39, in find_unavailable_packages
2018-09-28 11:08:20+0530 [-]     importlib.import_module(package)
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/importlib/__init__.py", line 126, in import_module
2018-09-28 11:08:20+0530 [-]     return _bootstrap._gcd_import(name[level:], package, level)
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2018-09-28 11:08:20+0530 [-]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn_crfsuite/__init__.py", line 2, in <module>
2018-09-28 11:08:20+0530 [-]     from .estimator import CRF
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn_crfsuite/estimator.py", line 10, in <module>
2018-09-28 11:08:20+0530 [-]     from sklearn_crfsuite.compat import BaseEstimator
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn_crfsuite/compat.py", line 3, in <module>
2018-09-28 11:08:20+0530 [-]     from sklearn.base import BaseEstimator
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/__init__.py", line 64, in <module>
2018-09-28 11:08:20+0530 [-]     from .base import clone
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/base.py", line 13, in <module>
2018-09-28 11:08:20+0530 [-]     from .utils.fixes import signature
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/utils/__init__.py", line 13, in <module>
2018-09-28 11:08:20+0530 [-]     from .validation import (as_float_array,
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/utils/validation.py", line 27, in <module>
2018-09-28 11:08:20+0530 [-]     from ..utils._joblib import Memory
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/utils/_joblib.py", line 18, in <module>
2018-09-28 11:08:20+0530 [-]     from ..externals.joblib import __all__   # noqa
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/externals/joblib/__init__.py", line 119, in <module>
2018-09-28 11:08:20+0530 [-]     from .parallel import Parallel
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 22, in <module>
2018-09-28 11:08:20+0530 [-]     from ._multiprocessing_helpers import mp
2018-09-28 11:08:20+0530 [-]   File "/home/nishantgautam/data/Regalix-Nishant/python-envs/avas-botpress-rasa/lib/python3.6/site-packages/sklearn/externals/joblib/_multiprocessing_helpers.py", line 34, in <module>
2018-09-28 11:08:20+0530 [-]     _sem = Semaphore()
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/context.py", line 82, in Semaphore
2018-09-28 11:08:20+0530 [-]     return Semaphore(value, ctx=self.get_context())
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/synchronize.py", line 127, in __init__
2018-09-28 11:08:20+0530 [-]     SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/synchronize.py", line 81, in __init__
2018-09-28 11:08:20+0530 [-]     register(self._semlock.name)
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/semaphore_tracker.py", line 83, in register
2018-09-28 11:08:20+0530 [-]     self._send('REGISTER', name)
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/semaphore_tracker.py", line 90, in _send
2018-09-28 11:08:20+0530 [-]     self.ensure_running()
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/semaphore_tracker.py", line 71, in ensure_running
2018-09-28 11:08:20+0530 [-]     pid = util.spawnv_passfds(exe, args, fds_to_pass)
2018-09-28 11:08:20+0530 [-]   File "/usr/lib/python3.6/multiprocessing/util.py", line 417, in spawnv_passfds
2018-09-28 11:08:20+0530 [-]     False, False, None)
2018-09-28 11:08:20+0530 [-] ValueError: bad value(s) in fds_to_keep
2018-09-28 11:08:20+0530 [-] 2018-09-28 11:08:20 WARNING  rasa_nlu.data_router  - [Failure instance: Traceback (failure with no frames): <class 'rasa_nlu.train.TrainingException'>: bad value(s) in fds_to_keep
2018-09-28 11:08:20+0530 [-] ]

BOTPRESS Logs

11:08:20 - debug: [NLU::Rasa] The model needs to be updated
11:08:20 - debug: [NLU::Rasa] Started training model from 58 samples
11:08:20 - error: [NLU::Rasa] Error syncing model: "[object Object]" Status: undefined | Message: Request failed with status code 500

Botpress and Rasa NLU
#8

What version of RASA_nlu you are running? Also share the config/nlu.json you are using now and a screenshot of Rasa_nlu directory.


#9

@Haythamamin @dmytropanontko

The problem was with scikit-learn version.

Error

scikit-learn==0.20.0

No Error

scikit-learn==0.19.2

We downgraded from 0.20.0 to 0.19.2 and it works.

Appreciate all help :slight_smile:


#10

@ngautam0 If possible , could you share the steps for RASA integration and usage of entities in it? This would help the community.


#11

@jainsourabh2

Soon I’ll put out a tutorial on how to do it step by step.

Will provide a link here .

Cheers


#12

Thanks @ngautam0 . It will be great to have a tutorial for the community.


#13

@jainsourabh2

Hi , i am also facing the same issue. Can you please tell me how you downgraded the version of scikit-learn to 0.19.2.
Thanks


#14

Please do it in a virtualenv, so that it dose not affect your system python environment.

Use below command :

pip install scikit-learn==0.19.2


#15

hi guys - i tried to integrate botpress with Rasa NLU.
i followed the above steps and was able to -

  1. install Rasa
  2. start Rasa NLU server so that it is listening at 5000 port (python -m rasa_nlu.server --path botpress -c config.yaml)
  3. updated the nlu.json file under out\bp\data\global\config\ to change the provider to “rasa”

now when i start Botpress in the beginning i saw below error:

c:\Botpress\botpress>yarn start
yarn run v1.12.3
$ cd ./out/bp && cross-env NODE_PATH=./ cross-env BP_MODULES_PATH=../../modules node index.js
05:06:46.279 Launcher ========================================
                      Botpress Server - Community Edition
                                   Version 11.0.4
                      ========================================
05:06:47.106 Launcher Using 5 modules
                      ⦿ MODULES_ROOT/channel-web
                      ⦿ MODULES_ROOT/nlu
                      ⊝ MODULES_ROOT/hitl (disabled)
                      ⦿ MODULES_ROOT/qna
                      ⦿ MODULES_ROOT/basic-skills
                      ⊝ MODULES_ROOT/audience (disabled)
                      ⦿ MODULES_ROOT/analytics
05:06:47.307 CMS Loaded 6 content types
05:06:47.339 Server Loaded 5 modules
05:06:48.367 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:06:48.405 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:06:48.446 Mod[nlu] [NLU::Rasa] The model needs to be updated
05:06:48.447 Mod[nlu] [NLU::Rasa] Started training model from 26 samples
05:06:48.486 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:06:48.488 Server Started in 1378ms
05:06:48.490 Launcher Botpress is ready at http://localhost:3000/
05:06:48.528 Mod[nlu] [NLU::Rasa] The model needs to be updated
05:06:48.532 Mod[nlu] [NLU::Rasa] Started training model from 21 samples
05:06:48.552 Mod[nlu] [NLU::Rasa] Error syncing model: "[object Object]" Status: undefined | Message: Request failed with status code 403
05:06:48.566 Launcher Unhandled Rejection [Error, Request failed with status code 500]
----- STACK -----
Error: Request failed with status code 500
    at createError (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\core\createError.js:16:15)
    at settle (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\core\settle.js:18:12)
    at IncomingMessage.handleStreamEnd (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\adapters\http.js:201:11)
    at IncomingMessage.emit (events.js:187:15)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

After that i went to the NLU tab of the Welcome bot that comes by default with Bptpress and clicked on the Sync button. this worked successfully and i could see that in the console logs of Botpress

05:07:19.156 HookService Executed "00_dialog_engine.js" on "after_incoming_middleware"
05:07:20.489 Mod[nlu] [NLU::Rasa] Synced model [Model=model_20181125-050718]
05:07:51.013 HookService Executed "00_dialog_engine.js" on "after_incoming_middleware"
05:07:58.966 Mod[nlu] [NLU::Rasa] The model needs to be updated
05:07:58.969 Mod[nlu] [NLU::Rasa] Started training model from 21 samples
05:08:25.230 Mod[nlu] [NLU::Rasa] Synced model [Model=model_20181125-050822]

Now i closed the rasa and Botpress server and did the below sequence.

started Rasa server again. it shows following in the console

C:\Users\hpuser\rasa\botpress>python -m rasa_nlu.server --path botpress -c config.yaml
2018-11-25 05:22:56+0530 [-] Log opened.
2018-11-25 05:22:56+0530 [-] Site starting on 5000
2018-11-25 05:22:56+0530 [-] Starting factory <twisted.web.server.Site instance at 0x00000000170EE308>

then i started the Botpress server. it shows following in the rasa server comsole:

2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "GET /status HTTP/1.1" 200 433 "-" "axios/0.17.1"
2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "GET /status HTTP/1.1" 200 433 "-" "axios/0.17.1"
2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "GET /status HTTP/1.1" 200 436 "-" "axios/0.17.1"
2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "GET /status HTTP/1.1" 200 436 "-" "axios/0.17.1"
2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "POST /train?project=dev__botpress__all HTTP/1.1" 403 62 "-" "axios/0.17.1"
2018-11-25 05:24:01+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:00 +0000] "GET /status HTTP/1.1" 200 436 "-" "axios/0.17.1"
Fitting 2 folds for each of 6 candidates, totalling 12 fits
C:\Python27\lib\site-packages\sklearn\metrics\classification.py:1135: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.
  'precision', 'predicted', average, warn_for)
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.0s finished
2018-11-25 05:24:18+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:17 +0000] "POST /train?project=dev__botpress__all HTTP/1.1" 200 70 "-" "axios/0.17.1"
2018-11-25 05:24:18+0530 [-] "127.0.0.1" - - [24/Nov/2018:23:54:17 +0000] "GET /status HTTP/1.1" 200 467 "-" "axios/0.17.1"

and following in the Botpress server logs:

c:\Botpress\botpress>yarn start
yarn run v1.12.3
$ cd ./out/bp && cross-env NODE_PATH=./ cross-env BP_MODULES_PATH=../../modules node index.js
05:23:58.890 Launcher ========================================
                      Botpress Server - Community Edition
                                   Version 11.0.4
                      ========================================
05:23:59.733 Launcher Using 5 modules
                      ⦿ MODULES_ROOT/channel-web
                      ⦿ MODULES_ROOT/nlu
                      ⊝ MODULES_ROOT/hitl (disabled)
                      ⦿ MODULES_ROOT/qna
                      ⦿ MODULES_ROOT/basic-skills
                      ⊝ MODULES_ROOT/audience (disabled)
                      ⦿ MODULES_ROOT/analytics
05:23:59.953 CMS Loaded 6 content types
05:23:59.992 Server Loaded 5 modules
05:24:01.041 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:24:01.081 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:24:01.135 Mod[nlu] [NLU::Rasa] The model needs to be updated
05:24:01.139 Mod[nlu] [NLU::Rasa] Started training model from 26 samples
05:24:01.189 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
05:24:01.202 Server Started in 1462ms
05:24:01.206 Launcher Botpress is ready at http://localhost:3000/
05:24:01.223 Mod[nlu] [NLU::Rasa] The model needs to be updated
05:24:01.230 Mod[nlu] [NLU::Rasa] Started training model from 16 samples
05:24:01.247 Mod[nlu] [NLU::Rasa] Error syncing model: "[object Object]" Status: undefined | Message: Request failed with status code 403
05:24:01.254 Launcher Unhandled Rejection [Error, Request failed with status code 500]
----- STACK -----
Error: Request failed with status code 500
    at createError (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\core\createError.js:16:15)
    at settle (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\core\settle.js:18:12)
    at IncomingMessage.handleStreamEnd (c:\Botpress\botpress\modules\qna\node_modules\axios\lib\adapters\http.js:201:11)
    at IncomingMessage.emit (events.js:187:15)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
05:24:18.153 Mod[nlu] [NLU::Rasa] Synced model [Model=model_20181125-052416]

is this behavior OK ?

after this if i try to test welcome bot, i see the below error when i say hello to the bot

05:29:42.908 HookService Executed "00_dialog_engine.js" on "after_incoming_middleware"
05:29:57.416 Mod[nlu] Error extracting metadata for incoming text: operation timed out after 208 ms, 3 tries with error: Cannot read property 'modelId' of undefined
05:29:57.427 HookService Executed "00_dialog_engine.js" on "after_incoming_middleware"
05:29:57.439 DialogEngine Flow started.
05:29:57.512 Actions Running "getUserVariable"
TypeError: Cannot read property 'intent' of undefined
    at Object.<anonymous> (vm.js:3:24)
    at NodeVM.run (c:\Botpress\botpress\node_modules\vm2\lib\main.js:419:27)
    at Promise (c:\Botpress\botpress\out\bp\core\services\action\vm.js:9:37)
    at Promise._execute (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\debuggability.js:313:9)
    at Promise._resolveFromExecutor (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:79:10)
    at VmRunner.runInVm (c:\Botpress\botpress\out\bp\core\services\action\vm.js:7:16)
    at TransitionStrategy.<anonymous> (c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:176:33)
    at Generator.next (<anonymous>)
    at c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:19:71
05:29:57.649 Transition Condition "state.$r !== undefined" OK for "welcome"
05:29:57.681 DialogEngine (main.flow.json)[entry] -> [welcome]
05:29:57.741 Actions Output "#!builtin_text-pSsHWg"
05:29:57.815 Actions Running "incrementNumberOfConversations"
TypeError: Cannot read property 'intent' of undefined
    at Object.<anonymous> (vm.js:3:24)
    at NodeVM.run (c:\Botpress\botpress\node_modules\vm2\lib\main.js:419:27)
    at Promise (c:\Botpress\botpress\out\bp\core\services\action\vm.js:9:37)
    at Promise._execute (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\debuggability.js:313:9)
    at Promise._resolveFromExecutor (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:79:10)
    at VmRunner.runInVm (c:\Botpress\botpress\out\bp\core\services\action\vm.js:7:16)
    at TransitionStrategy.<anonymous> (c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:176:33)
    at Generator.next (<anonymous>)
    at c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:19:71
05:29:57.999 Transition Condition "state.$r > 0" OK for "many-times"
05:29:58.028 DialogEngine (main.flow.json)[welcome] -> [many-times]
05:29:58.088 Actions Output "#!builtin_text-bFsOmf"
TypeError: Cannot read property 'intent' of undefined
    at Object.<anonymous> (vm.js:3:24)
    at NodeVM.run (c:\Botpress\botpress\node_modules\vm2\lib\main.js:419:27)
    at Promise (c:\Botpress\botpress\out\bp\core\services\action\vm.js:9:37)
    at Promise._execute (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\debuggability.js:313:9)
    at Promise._resolveFromExecutor (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:79:10)
    at VmRunner.runInVm (c:\Botpress\botpress\out\bp\core\services\action\vm.js:7:16)
    at TransitionStrategy.<anonymous> (c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:176:33)
    at Generator.next (<anonymous>)
    at c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:19:71
05:29:58.227 Transition Condition "true" OK for "END"
05:29:58.272 DialogEngine Flow ended.

#16

If i removed the global transition that is present in the Welcome Bot as

event.nlu.intent.name === 'forget'

i don’t get the below error that i was getting above:

05:29:57.512 Actions Running "getUserVariable"
TypeError: Cannot read property 'intent' of undefined

does it means that when we integrate with Rasa NLU, we need to access intent in a different way? are there any examples or documentation of this ?

Also what is the significance of this error in the console:

05:29:57.416 Mod[nlu] Error extracting metadata for incoming text: operation timed out after 208 ms, 3 tries with error: Cannot read property 'modelId' of undefined

thanks in advance !


#17

Hello

ERROR : TypeError: Cannot read property 'intent' of undefined
This error will occur if you don’t have your NLU model synced. Please go to NLU module and check if it says “Model is up to date”, or “Sync”

ERROR : 05:29:57.416 Mod[nlu] Error extracting metadata for incoming text: operation timed out after 208 ms, 3 tries with error: Cannot read property 'modelId' of undefined

Once you have your model synced and Rasa server is up and running, this error should not appear.


#18

I would suggest getting started with docker - rasa.

  1. Install docker
  1. Run rasa using docker
  • docker run -p 5000:5000 rasa/rasa_nlu:latest-spacy
  1. Run botpress as usual, and then sync model

#19

Hi @ngautam0 thanks for your response.
Let me also share with you my folder structure.

After i instvalled the rasa as explained:

i created a directory rasa.
inside that i created the config.yaml s explained in this post.

I did the following to check the NLU model sync part.
i deleted all my bots to start from a clean slate.
i also deleted any models generated previously inside my rasa folder.

Now i first start the NLU server by using the below command as explained in the post:

I see no error on the rasa server console so far:

C:\Users\hpuser\rasa>python -m rasa_nlu.server --path botpress -c config.yaml
2018-11-27 02:43:20+0530 [-] Log opened.
2018-11-27 02:43:20+0530 [-] Site starting on 5000
2018-11-27 02:43:20+0530 [-] Starting factory <twisted.web.server.Site instance at 0x0000000017A52708>

My nlu.json looks like this:

{
  "$schema": "../../../assets/modules/nlu/config.schema.json",
  "intentsDir": "./intents",
  "entitiesDir": "./entities",
  "modelsDir": "./models",
  "provider": "rasa",
  "debugModeEnabled": true,
  "minimumConfidence": 0.3,
  "maximumConfidence": 100,
  "rasaEndpoint": "http://localhost:5000",
  "rasaProject": "botpress",
  "luisAppRegion": "westus",
  "maximumRequestsPerHour": 1000
}

Now i start my botpress server and it also starts clean. no issues so far.

c:\Botpress\botpress>yarn start
yarn run v1.12.3
$ cd ./out/bp && cross-env NODE_PATH=./ cross-env BP_MODULES_PATH=../../modules node index.js
02:54:26.870 Launcher ========================================
                      Botpress Server - Community Edition
                                   Version 11.0.4
                      ========================================
02:54:27.763 Launcher Using 5 modules
                      ⦿ MODULES_ROOT/channel-web
                      ⦿ MODULES_ROOT/nlu
                      ⊝ MODULES_ROOT/hitl (disabled)
                      ⦿ MODULES_ROOT/qna
                      ⦿ MODULES_ROOT/basic-skills
                      ⊝ MODULES_ROOT/audience (disabled)
                      ⦿ MODULES_ROOT/analytics
02:54:27.987 CMS Loaded 6 content types
02:54:28.018 Server Loaded 5 modules
02:54:28.812 Server Started in 1045ms
02:54:28.813 Launcher Botpress is ready at http://localhost:3000/

Now i launch Botpress Admin Panel, and Create my first bot “TestRasa”. And when i press Submit the bot is created successfully. I see below logs in the following consoles.

Botpress Server Console

02:57:57.374 HookService Executed "00_create_shortlink.js" on "after_bot_mount"
02:57:57.485 Mod[nlu] [NLU::Rasa] The model needs to be updated
02:57:57.486 Mod[nlu] [NLU::Rasa] Started training model from 24 samples
02:58:17.488 Mod[nlu] [NLU::Rasa] Synced model [Model=model_20181127-025816]

Rasa Server Console

2018-11-27 02:56:35+0530 [-] Timing out client: IPv4Address(type='TCP', host='127.0.0.1', port=56351)
2018-11-27 02:57:57+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:27:57 +0000] "GET /status HTTP/1.1" 200 299 "-" "axios/0.17.1"
2018-11-27 02:57:57+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:27:57 +0000] "GET /status HTTP/1.1" 200 299 "-" "axios/0.17.1"
Fitting 2 folds for each of 6 candidates, totalling 12 fits
C:\Python27\lib\site-packages\sklearn\metrics\classification.py:1135: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.
  'precision', 'predicted', average, warn_for)
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.0s finished
2018-11-27 02:58:17+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:28:17 +0000] "POST /train?project=dev__botpress__all HTTP/1.1" 200 70 "-" "axios/0.17.1"
2018-11-27 02:58:17+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:28:17 +0000] "GET /status HTTP/1.1" 200 544 "-" "axios/0.17.1"

i can also see that after created by bot, the following folder structure / files is created inside the rasa folder

rasa
---botpress
------dev__botpress__all
---------model_20181127-025816
------------intent_classifier_sklearn.pkl
------------metadata.json
------------regex_featurizer.json
------------training_data.json

Now if at this point i go to the NLU tab of my bot TestRasa, it shows “Model is up to date”.

Does this means that all is well until now Or anything looks incorrect? any idea? can i assume that my models from botpress are synced into Rasa successfully ?

i can also see that whatever intents the bot defines in botpress are present in the training_data.json:

{
  "rasa_nlu_data": {
    "common_examples": [
      {
        "text": "don't remember my name", 
        "intent": "forget"
      }, 
      {
        "text": "delete my name from your memory", 
        "intent": "forget"
      }, 
      {
        "text": "erase my name", 
        "intent": "forget"
      }, 
      {
        "text": "forget name", 
        "intent": "forget"
      }, 
      {
        "text": "forget", 
        "intent": "forget"
      }, 
      {
        "text": "please forget my name", 
        "intent": "forget"
      }, 
      {
        "text": "forget my name", 
        "intent": "forget"
      }, 
      {
        "text": "good day!", 
        "intent": "hello"
      }, 
      {
        "text": "good morning", 
        "intent": "hello"
      }, 
      {
        "text": "holla", 
        "intent": "hello"
      }, 
      {
        "text": "bonjour", 
        "intent": "hello"
      }, 
      {
        "text": "hey there", 
        "intent": "hello"
      }, 
      {
        "text": "hi bot", 
        "intent": "hello"
      }, 
      {
        "text": "hey bot", 
        "intent": "hello"
      }, 
      {
        "text": "hey robot", 
        "intent": "hello"
      }, 
      {
        "text": "hey!", 
        "intent": "hello"
      }, 
      {
        "text": "hi", 
        "intent": "hello"
      }, 
      {
        "text": "hello", 
        "intent": "hello"
      }, 
      {
        "text": "yo", 
        "intent": "hello"
      }, 
      {
        "text": "yoyoyo", 
        "intent": "hello"
      }, 
      {
        "text": "plup!", 
        "intent": "hello"
      }, 
      {
        "text": "!&#^&*$^*(%", 
        "intent": "none"
      }, 
      {
        "text": "1234567", 
        "intent": "none"
      }, 
      {
        "text": "abcdefg", 
        "intent": "none"
      }
    ], 
    "entity_synonyms": [], 
    "regex_features": [], 
    "lookup_tables": []
  }
}

However if i now say Hi to my bot, it throws the same erorr:

03:13:41.749 DialogEngine Flow started.
03:13:41.795 Actions Running "getUserVariable"
TypeError: Cannot read property 'intent' of undefined
    at Object.<anonymous> (vm.js:3:24)
    at NodeVM.run (c:\Botpress\botpress\node_modules\vm2\lib\main.js:419:27)
    at Promise (c:\Botpress\botpress\out\bp\core\services\action\vm.js:9:37)
    at Promise._execute (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\debuggability.js:313:9)
    at Promise._resolveFromExecutor (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:483:18)
    at new Promise (c:\Botpress\botpress\modules\channel-web\node_modules\bluebird\js\release\promise.js:79:10)
    at VmRunner.runInVm (c:\Botpress\botpress\out\bp\core\services\action\vm.js:7:16)
    at TransitionStrategy.<anonymous> (c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:176:33)
    at Generator.next (<anonymous>)
    at c:\Botpress\botpress\out\bp\core\services\dialog\instruction\strategy.js:19:71
03:13:41.931 Transition Condition "true" OK for "ask-name"
03:13:41.953 DialogEngine (main.flow.json)[entry] -> [ask-name]
03:13:41.984 Actions Output "#!builtin_text-z0J9qh"

and i can see following on my Rasa console:

2018-11-27 03:13:41+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:43:40 +0000] "POST /parse HTTP/1.1" 404 50 "-" "axios/0.17.1"
2018-11-27 03:13:41+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:43:41 +0000] "POST /parse HTTP/1.1" 404 50 "-" "axios/0.17.1"
2018-11-27 03:13:41+0530 [-] "127.0.0.1" - - [26/Nov/2018:21:43:41 +0000] "POST /parse HTTP/1.1" 404 50 "-" "axios/0.17.1"

One more observation. if i directly run the following URL in browser:

http://localhost:5000/parse?q=hi&project=botpress

i get error response as below:

{
  "error": "No project found with name 'botpress'."
}

But if run the below URL:

http://localhost:5000/parse?q=hi&project=dev__botpress__all

i seem to get correct response back from Rasa server:

{
  "project": "dev__botpress__all", 
  "entities": [], 
  "intent": {
    "confidence": 0.89150619062586, 
    "name": "hello"
  }, 
  "text": "hi", 
  "model": "model_20181127-025816", 
  "intent_ranking": [
    {
      "confidence": 0.89150619062586, 
      "name": "hello"
    }, 
    {
      "confidence": 0.07939816848019406, 
      "name": "none"
    }, 
    {
      "confidence": 0.029095640893945906, 
      "name": "forget"
    }
  ]
}

Any suggestion to resolve the issue would be highly appreciated.


#20

Looks i would need Windows Pro or enterprise which i don’t currenly have.