In task 2 we tried to use a "hack" to get our model to speak. In this task we will add two more ingredients:
- Multi-task learning
- Specifying token types
As you will (hopefully) see this greatly improves the model.
Note: This task is heavily influenced by this blog post on building dialog models based on the Personachat dataset which was the winning approach in the ConvAI2 challenge in 2018.
Again you can use the local version or the Colab for this task.
- If you haven't already, clone the repository
- Make sure you have PyTorch with GPU-support installed. Follow the instructions here here to install the proper version depending on your OS. Also make sure you are using Python 3.6+. Then run:
pip install -r 3/requirements.txt
- Make sure you have placed your conversational dataset (JSON file) into the folder
3/data/
- Use
python train.py --run_name run1
to train your first model - Use
python interact.py --run_name run1
to interact
If you want to talk to your bot in Slack (instead of through the command line) do the following:
- Create a Slack app and get your API token
- Find your user ID (member ID) from your Slack
- Set two environment variables
export SLACK_API_TOKEN=<API token>
export SLACK_USER=<your user id>
- Run
python interact_slack.py --run_name run1
- You should see the bot is now online and you can start talking to it.