-
the Training data in
YAML
format data/{nlu.yml, stories.yml, rules.yml} and domain/{domain.yml} -
the Training data in
JSON
format json_data/{nlu.yml, stories.yml, rules.yml, domain.yml} -
The Custom importer script (custom_importer.py)
-
Two sperate Scripts to convert data from
JSON
toYAML
and vice versa -
The configuration file (config.yaml)
- Install and init Rasa
- Add the custom Importer in you rasa project directories
- Add the Importer in the config file
- To install Rasa on Ubuntu we should first install a modern python version.
# First we should update apt, just in case.
sudo apt update
# Install python
sudo apt install python3-dev python3
# Once it is installed you should be able to confirm the versions.
python3 --version
pip3 --version
- Now that we have these tools installed we can create a folder for our Rasa project.
# Create and Enter Folders
mkdir rasaprojects
cd rasaprojects
# Next we install python3-pip so that we can install python packages
sudo apt install python3-venv
# We can now create a virtualenv
python3 -m venv ./venv
- With our virtualenv available we can now active it and install Rasa.
# Source the virtualenv
source ./venv/bin/activate
# Install Rasa and Upgrade pip
python -m pip install --upgrade pip rasa
# Our `python` now refers to the python version in the virtualenv.
# From here you should be able to use Rasa
python -m rasa --help
python -m rasa init
- Now we can use
rasa train
andrasa shell
- Creat a new python file called
custom_importer.py
- copy the content from same file from the git repo
- Open
config.yaml
and add the importer section - The defult importer used with rasa is the
RasaFileImporter
importers:
- name: "RasaFileImporter"
-
Add the Custom importer and add a
repository
parametar (one indent) -
But there the git repo name in this case the repo name is
AbdelwahabAdam/hopa-rasa-demo
importers:
- name: "custom_importer.MyImporter"
repository: "AbdelwahabAdam/hopa-rasa-demo"
- NOTE
- you can add the defult importer as well and rasa will combine the both, but Data directory must be there in your project dir.
importers:
- name: "RasaFileImporter"
- name: "custom_importer.MyImporter"
repository: "AbdelwahabAdam/hopa-rasa-demo"
- First call
rasa train
- Then if every thing works well call
rasa shell
to test the bot in the terminal