2022-02-21 00:58:25 +00:00
# ebooks
2022-02-22 22:17:38 +00:00
Fediverse ebooks bot using neural networks
2022-02-21 18:39:37 +00:00
## Usage
2022-02-22 22:17:38 +00:00
First, install Python dependencies with `pip install psycopg2 torch transformers datasets Mastodon.py` . Currently only Mastodon with PostgreSQL is supported, but it should be easy to add support for other platforms and databases.
2022-02-21 20:29:28 +00:00
2022-02-21 21:37:58 +00:00
Generate the training data from the Mastodon database using `python data.py -d 'dbname=test user=postgres password=secret'` .
2022-02-21 18:39:37 +00:00
Next, train the network with `python train.py` , which may take several hours.
Finally, create a Mastodon application for your bot account and run the bot with `python bot.py -i mastodon.instance -t access_token` . Enjoy!
2022-02-22 04:45:36 +00:00
## Resources
- https://closeheat.com/blog/pytorch-lstm-text-generation-tutorial
- https://trungtran.io/2019/02/08/text-generation-with-pytorch/
2022-02-22 22:17:38 +00:00
- https://huggingface.co/docs/transformers/training
- https://huggingface.co/blog/how-to-generate