Train chatbot on your Telegram chat

Dmitry Vinnik
2 min readMar 1, 2021
  1. Export chat history in the Group info menu:

2. Create a new Google Drive (a model checkpoint that replaces the old one goes to trash, and it is big enough to fill up your disk quick), create chatbot_data folder, and put result.json there:

3. Install something like a colab-alive extension

4. Open train_chatbot.ipynb

5. Go to Runtime > Run all

6. Mount your drive (press enter after pasting a code):

7. Check the train-test-valid split to be correct (i.e., nonzero, big enough)

8. After training has started, do not close the browser tab until you go out of the quota (about 10 hours)

9. Open run_chatbot.ipynb

10. Run setup cells (installing parlai, mounting the drive)

11. Run this cell to show what model answers on the test data:

(“labels” is what the model was trained to answer, “model” is the actual model output. More examples are present in a run_chatbot.ipynb cell output)

12. To chat with the model, run this cell:

The GitHub repo with the notebooks.

--

--

Dmitry Vinnik

Master of Science in Artificial Intelligence, San Francisco, CA