An open API service indexing awesome lists of open source software.

https://github.com/thepushkarp/impersonator

A Telegram bot that takes in an exported WhatsApp chat and uses it to send you text in your and your friend's writing style 😎
https://github.com/thepushkarp/impersonator

markov-chain recurrent-neural-networks rnn telegram-bot

Last synced: about 1 year ago
JSON representation

A Telegram bot that takes in an exported WhatsApp chat and uses it to send you text in your and your friend's writing style 😎

Awesome Lists containing this project

README

          

Impersonator


LGTM Grade
GitHub Issues
LGTM Alerts
Stargazers
License

A Telegram bot that takes in an exported WhatsApp chat and uses it to send you text in your and your friend's writing style 😎

---

**Disclaimer**: _This project was made for fun to explore the possibilities of text generation. DO NOT use this with somebody's data without their proper consent._

Impersonator can generate texts in two ways:

- The `/impersonate` command uses Markov Chains
- The `/impersonate2` command uses Character Level RNNs

NOTE: Currently tested only for WhatsApp Chats exported from Android.

## How to run?

- Run `pip install -r requirements.txt`
- Place the exported chat in the root folder as `chats.txt`.
- Add the names of people who you want to personate using the bot in a new line in `user_names.txt`, as they appear in your exported chat.
Ex: If you have someone's number saved as 'Birdy Bro 2', add this full name in the file.
- Run `python clean.py` to clean the chat file.
- Then run the impersonator version that you want to use
- To impersonate using Markov Chains, run `create_markov.py` (Recommended).
- To impersonate using RNN, follow [this Colab link](https://colab.research.google.com/drive/1lRsuBCVRzl8zu8lxuGyron9tqt3h5heM?usp=sharing) to generate the text files and then save them offline (Optional and less stable than Markov Chains).
- In the `.env` file, add the Telegram Bot token you get from [BotFather](https://core.telegram.org/bots#6-botfather) and your your Heroku WebHook URL for deploying this.
- Deploy to [Heroku](https://devcenter.heroku.com/articles/getting-started-with-python).
- Have Fun impersonating 🖖.

## Thanks

- [Filip Hracek](https://github.com/filiph) who created the [Automatic Donald Trump](https://filiph.github.io/markov/) which was the inspiration for this project.
- [Max Woolf](https://github.com/minimaxir) who developed [textgenrnn](https://github.com/minimaxir/textgenrnn) that uses Character-level RNNs. Check [here](https://karpathy.github.io/2015/05/21/rnn-effectiveness/) to read more about Karapathy's blog on char-rnn.
- [Jeremy Singer-Vine](https://github.com/jsvine) who developed [markovify](https://github.com/jsvine/markovify) that made developing the Markov Chain Models a lot easier.
- My friends who extensively tested the initial versions of this and suggesting further improvements.