Fediverse ebooks bot using neural networks https://social.exozy.me/@ta180m/107833248217767420
Go to file
2022-02-28 20:43:44 -06:00
.gitignore Initial commit 2022-02-20 18:58:25 -06:00
bot.py WIP: Add Pleroma and Misskey support 2022-02-27 18:00:22 -06:00
bot_lstm.py Add new transformers bot script and move old one to bot_lstm.py 2022-02-22 16:58:19 -06:00
data.py Modify data generation script for transformers 2022-02-22 16:57:12 -06:00
dataset.py More cleanup 2022-02-21 15:20:00 -06:00
LICENSE Switch to AGPL license 2022-02-28 20:43:44 -06:00
model.py More cleanup 2022-02-21 15:20:00 -06:00
predict.py Take top 5 instead of top 3 2022-02-21 16:39:58 -06:00
README.md WIP: Add Pleroma and Misskey support 2022-02-27 18:00:22 -06:00
train.py Reformat code with autopep8 2022-02-22 17:55:04 -06:00
train_lstm.py Move train.py to train_lstm.py and add new transformers training code 2022-02-22 16:12:13 -06:00

ebooks

Fediverse ebooks bot using neural networks

Usage

First, install Python dependencies using your distro's package manager or pip: psycopg2, torch, transformers, and datasets. Additionally, for Mastodon and Pleroma, install Mastodon.py, and for Misskey, install Misskey.py. If your database or platform isn't supported, don't worry! It's easy to add support for other platforms and databases, and contributions are welcome!

Now generate the training data from your fediverse server's database using python data.py -d 'dbname=test user=postgres password=secret host=localhost port=5432'. You can skip this step if you have collected training data from another source.

Next, train the network with python train.py, which may take several hours. It's a lot faster when using a GPU. If you need advanced features when training, you can also train using run_clm.py.

Finally, create an application for your bot account and generate an access token. Run the bot with python bot.py -b server_type -i fediverse.instance -t access_token. You can omit -b server_type for Mastodon and Pleroma. To run the bot periodically, create a cron job. Enjoy!

Resources