This article will help explain the process of importing your conversational data into HF from Rasa. If you haven’t already, read up on our Part 1 of this series where we explain how to import an existing project.
Before syncing data from Rasa, you will first need to install the necessary HumanFirst CLI tool. You can find detailed instructions here.
Rasa <> HumanFirst
hf
allows conversations to be imported from the Tracker Store of an existing Rasa deployment. In order for this feature to work, a few dependencies and configuration are needed.
Dependencies
- The
rasa
command needs to be accessible from your shell. - The Rasa deployment needs to be configured and accessible for the machine running the command line tool. More precisely, you need a
endpoints.yml
file with a properly configured tracker_store section. - The python
rasa
package needs to be accessible when executing a python program in the current shell. This means that if Rasa got installed in a virtualenv, this virtual environment needs to be activated prior to executing thehf
command line.
Importing
Importing conversations from Rasa’s tracker into an existing workspace is as simple as executing:
$ hf rasa import-conversations — workspace playbook-QPGRXYTO45A4PLWNCNO6BJFC
in the directory in which the endpoints.yml
file is. It is also possible to specify the endpoints file from the command line:
$ hf rasa import-conversations — workspace playbook-QPGRXYTO45A4PLWNCNO6BJFC — endpoints /path/to/endpoints.yml
Working with conversations or utterances from sources other than Rasa
You may choose to import files using the command line tool in order to automate the synchronization with third party systems.
Conversations
You can import conversations in CSV format with hf conversation import — workspace [workspace id] ./conversations.csv
Example:
$ hf conversation import — workspace playbook-QPGRXYTO45A4PLWNCNO6BJFC ./conversations.csv
conversations.csv: File uploaded successfully
Utterances
You can import utterances the same way with hf utterance import — workspace [workspace id] ./utterances.txt
Example:
$ hf utterance import — workspace playbook-QPGRXYTO45A4PLWNCNO6BJFC ./utterances.txt
utterances.txt: File uploaded successfully