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 😎

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 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 and your your Heroku WebHook URL for deploying this.
  • Deploy to Heroku.
  • Have Fun impersonating πŸ––.

Thanks

  • Filip Hracek who created the Automatic Donald Trump which was the inspiration for this project.
  • Max Woolf who developed textgenrnn that uses Character-level RNNs. Check here to read more about Karapathy's blog on char-rnn.
  • Jeremy Singer-Vine who developed 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.

About

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 😎

License:MIT License


Languages

Language:Python 99.8%Language:Procfile 0.2%