Inspired by https://medium.com/huggingface/how-to-build-a-state-of-the-art-conversational-ai-with-transfer-learning-2d818ac26313 and https://towardsdatascience.com/speak-to-the-dead-with-deep-learning-a336ef88425d.
Put your chat data into impostor/data
This project was installed on conda, python version 3.9.
Pytorch installation:
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c=conda-forge
Hugging Face transformer install:
pip install transformers
Also requires (from pip):
- matplotlib
- pyyaml
- discord.py
And from conda:
- ftfy
- spacy
- Make a directory with exported LINE chat logs. Remove the headers in each of the files.
- Put this directory in the
chat_log_directory
inconfig.yaml
. - Put your LINE username into the
user_name
field inconfig.yaml
. - Enter a file location for the dataset in the
dataset/file
field. - Run
create_dataset.py
. - Configure training parameters in
config.yaml
(especially thedevice
). - Run
train.py
. - Choose a model saved in the
checkpoints
folder and put it inmodel_path
inconfig.yaml
. - Create a discord bot.
- Put the bot secret in
bot_token
. - Invite the bot to your favourite server. Link should look like https://discord.com/oauth2/authorize?client_id=1234567890&permissions=68672&scope=bot
- Run
bot.py
- Chat with your bot!