Created
July 16, 2019 00:39
-
-
Save makyo/550339c49bc49ac9c51d76dda93e02f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import html2text | |
import markovify | |
with open('outbox.json', 'rb') as f: | |
outbox = json.load(f) | |
corpus = '' | |
for toot in outbox['orderedItems']: | |
if toot['type'] == 'Create': | |
corpus += '\n' + html2text.html2text(toot['object']['content']) | |
model = markovify.Text(corpus) | |
for i in range(5): | |
print(model.make_sentence()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use
Download your account archive and unzip it. Put
markovstodon.py
in the directory where you findoutbox.json