Working with the Rasa NLU starter-pack

I’ve installed Rasa Core and the Rasa Stack starter-pack on an AWS EC2 t2.micro instance.  Now, let’s explore the starter pack and see what it has to offer and what we can modify to fit my project – The Intent Engine.

Go into the virtual environment and the starter-pack directory

source intentengine/bin/activate
cd starter-pack-rasa-stack

Train the NLU

make train-nlu
#It runs this command:
python -m rasa_nlu.train -c nlu_config.yml --data data/nlu_data.md -o models --fixed_model_name nlu --project current --verbose

Train the Rasa Core, which includes dialog and task management

make train-core
#It runs this command
python -m rasa_core.train -d domain.yml -s data/stories.md -o models/current/dialogue -c policies.yml

Start the server for emulating the custom action.  Start it in the background so you can run the next command in the same terminal window.

make action-server&
#It runs this command
python -m rasa_core_sdk.endpoint --actions actions

Load the assistant in command line and try chatting

make cmdline
#It runs this command
python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --endpoints endpoints.yml

The starter pack first asks you your name and how it can help.  Then it follows with a Chuck Norris jokes.  Interaction is very lacking though.  After a joke or two it remembers your name and asks how it can help again.  Here is output of my initial command line interaction with the starter pack.

(intentengine) [ec2-user@ip-172-31-80-203 starter-pack-rasa-stack]$ make cmdline
python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --endpoints endpoints.yml
/home/ec2-user/intentengine/local/lib64/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to                           `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2019-02-27 01:34:45 INFO     root  - Rasa process starting
2019-02-27 01:34:46 INFO     rasa_nlu.components  - Added 'nlp_spacy' to component cache. Key 'nlp_spacy-en'.
2019-02-27 01:34:46 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib/python3.5/site-packages/rasa_nlu/extractors/entity_synonyms.py:85: UserWarning: F                          ailed to load synonyms file from 'models/current/nlu/entity_synonyms.json'
  "".format(entity_synonyms_file))

2019-02-27 01:34:46 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib/python3.5/site-packages/pykwalify/core.py:99: UnsafeLoaderWarning:
The default 'Loader' for 'load(stream)' without further arguments can be unsafe.
Use 'load(stream, Loader=ruamel.yaml.Loader)' explicitly if that is OK.
Alternatively include the following in your code:

  import warnings
  warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)'
  data = yaml.load(stream)

2019-02-27 01:34:53.456787: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-02-27 01:34:55 INFO     root  - Rasa Core server is up and running on http://localhost:5005
Bot loaded. Type a message and press enter (use '/stop' to exit):
Me> hello
2019-02-27 01:35:12 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib64/python3.5/site-packages/sklearn/preprocessing/label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

Rasa> Hey there! Tell me your name.
127.0.0.1 - - [2019-02-27 01:35:12] "POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1" 200 197 0.224093
Me> Joe
2019-02-27 01:35:38 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib64/python3.5/site-packages/sklearn/preprocessing/label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

Rasa> Nice to you meet you joe. How can I help?
127.0.0.1 - - [2019-02-27 01:35:38] "POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1" 200 209 0.019340
Me> What can you do?
2019-02-27 01:35:51 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib64/python3.5/site-packages/sklearn/preprocessing/label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

127.0.0.1 - - [2019-02-27 01:35:52] "POST /webhook HTTP/1.1" 200 303 0.839190
Rasa> Chuck Norris began selling the Total Gym as an ill-fated attempt to make his day-to-day opponents less laughably pathetic.
127.0.0.1 - - [2019-02-27 01:35:52] "POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1" 200 290 0.880567
Me> Not bad.  Tell me another.
2019-02-27 01:37:46 WARNING  py.warnings  - /home/ec2-user/intentengine/local/lib64/python3.5/site-packages/sklearn/preprocessing/label.py:151: DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
  if diff:

Rasa> Nice to you meet you joe. How can I help?
127.0.0.1 - - [2019-02-27 01:37:46] "POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1" 200 209 0.023175

Leave a Reply