/radio_murakami

A bot to provide daily inspirational quotes emulating Haruki Murakami

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Radio Murakami

Welcome to the Radio Murakami repository!

Here, we develop a bot that spouts out quotes as good as the writings of Haruki Murakami himself (okay, to a reasonable approximation). This is based off his writing style as well as quotes and interviews he has done in the past. We write about our work right at Daily Inspirational Quotes from Your Favorite Author using Deep Learning.

Data

We source our data from all of Murakami's novels, and various sources below.

Interviews & Short Essays

Tweets

@Murakami_kz

We have a simple utility here that allows you to scrape tweets of a Twitter account.

Model

We fine tuned a GPT-2 model using the datasets above. You can fine-tune the model simply by using a pre-trained GPT-2 model on the data from here.

Contributors

In this repository, we use pre-commit to ensure consistency of formatting. To install for Mac, run

brew install pre-commit

Once installed, in the command line of the repository, run

pre-commit install

This will install pre-commit to the Git hook, so that pre-commit will run and fix files covered in its config before committing.

Running

Run the Docker image by running the shell script run.sh. You can also run the trained model with

python docker/src/main.py <seed phrase> --num-samples <number of samples> --max-length <maximum token length> --model-dir <model weights path>

By default, <number of samples> is 50, <maximum token length> is 100, and <model weights path> is ./murakami_bot/. You can download our model here.

References

[1] Radford A., Wu J., Child R., Luan D., Amodei D., and Sutskever I., "Language Models are Unsupervised Multitask Learners", 2019. (link)

[2] Devlin J., Chang M-W., Lee K., and Toutanova K., "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding", Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume I (Long and Short Papers), pp. 4171-4186, June 2019. (link)

[3] Vaswani A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I, "Attention is all you need", Advances in Neural Information Processing Systems, pp. 5998–6008, 2017. (link)