DUMB chatbot
DUMB(Dumb Undereducated Maladroit Bot) chatbot, a chatbot implemented with PyTorch and trained with Cornell Movie Dialogs Corpus.
CAUTION
Under current support situation of PyTorch, MPS devices (commonly known as Apple Silicon GPU) suffer from extreme slow training, so just don't train with them now.
TODO:
- Breakpoint continuous training to achieve intermittent training.
- Migrate to Python3.
Requirements
- Python 3.10
- PyTorch 1.13.1
- torchaudio 0.13.1
- torchvision 0.14.1
- festival (Linux Environment)
- say (macOS Environment)
Training Resource
How to use
Data Laundry
python3 prerequisites.py
The script would create dialogue_corpus.txt
under ./data
.
Model Training
python3 train.py
Configs are stored in config.json
.
Model Training could be time-consuming. I would strongly recommend enabling CUDA in config.json
to accelerate the
whole training process.
{
"TRAIN": {
"DEVICE": "cuda",
...
}
}
And if you are using Apple Silicon GPUs, do the following:
{
"TRAIN": {
"DEVICE": "mps",
...
}
}
Testing and Running
python3 chatbot.py
Test Samples
> hi .
bot: hi .
> what is your name ?
bot: vector frankenstein .
> how are you ?
bot: fine .
> where are you from ?
bot: up north .
> are you happy today ?
bot: yes .
Though it could answer some questions, it's still dumb enough.
References
- seq2seq (Sequence to Sequence) Model for Deep Learning with PyTorch
- PyTorch documentation
- seq2seq-translation
- tensorflow_chatbot
- Cornell Movie Dialogs Corpus
Justin Lee!
Made with ❤ by™ and © 1997-2022 Justin Lee. All Rights Reserved. License Agreement