ebooks/README.md

24 lines
889 B
Markdown

# ebooks
Fediverse ebooks bot using neural networks
## Usage
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.
Generate the training data from the Mastodon database using `python data.py -d 'dbname=test user=postgres password=secret'`.
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!
## Resources
- https://closeheat.com/blog/pytorch-lstm-text-generation-tutorial
- https://trungtran.io/2019/02/08/text-generation-with-pytorch/
- https://huggingface.co/docs/transformers/training
- https://huggingface.co/blog/how-to-generate