Skip to content

Deep Learning-based Telegram bot trained wiht Machado de Assis' texts

Notifications You must be signed in to change notification settings

lsiddd/machado-bot

Repository files navigation

Text prediction using LSTMs

Ever wanted to talk to some of the greatest writers in brazilian literature? You still can't, he's dead. But you can talk to my tekegram bot based on his texts, spoiler: it sucks .

Note: if you have CUDA available change the LSTM occurrences to CuDNNLSTM for much faster training.

Ever wanted to talk to some of the greatest writers in Brazilian literature? You still can't, he's dead. But you can talk to my telegram bot based on his texts, spoiler: it sucks.

To run the bot on your own server, just execute

python3 bot.py

And it will run with the architecture specified (the code already ships with trained weights). Make sure to have a valid access token in the code though. Check [this link] (https://core.telegram.org/bots) if you have any doubts.

To train the network with your own texts you fist need to preprocess it specifying the text file in preprocessing.py to remove noise, and then the preprocessed file in model.py.

Then just run:

python3 model.py

Note that this performs a grid search to find the best network architecture and then trains it, so it might take some time.

This work builds upon the one presented below, if you are interested please check this blog post.

Acknowledgements from the original author

About

Deep Learning-based Telegram bot trained wiht Machado de Assis' texts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published