This is a template integrating the click
command line suite and the rasa
chat agent.
-
Train the interpreter (rasa_nlu)
./agent.py train_nlu -r data/nlu.md
-
Train the policy (keras)
./agent.py train_policy -d data/domain.yaml -s data/stories.md
-
Chat with the agent
./agent.py chat
After training the interpreter and training the policy, you can visualize the graph by running (note, this requires installing graphviz as descriped in Setup
below):
./agent.py visualize -s data/stories.md story-graph.png
These setup instructions assume a modern version of Python 3.5+, but it should work on Python 2.7+ or Python 3.3+.
-
clone the repository, and enter the directory:
git clone https://github.com/dfee/rasa_nlu_cli.git && cd rasa_nlu_cli
-
create a virtualenv (and we'll activate it too):
python3 -m venv env && source env/bin/activate
-
install the dependencies:
pip install -r requirements.txt
-
install the spacy language files:
python -m spacy download en
-
(optional) install
graphviz
to enable visualizationFor MacOS (assuming homebrew is installed):
brew install graphviz && pip install pygraphviz
For Ubuntu (or anything in the Debian family using
apt
):apt-get -qq install -y graphviz libgraphviz-dev pkg-config && pip install pygraphviz