It’s been awhile since I’ve posted here and that’s mostly because I’ve been busy or didn’t think about it. Sorry.
Anyway, lately I’ve been thinking about trying to make a sapient Reddit bot. Why? Boredom. The only thing left to decide is how.
So the language I’ve decided to go with will be Python. Python is a pretty light weight language that’s easy to script in, assuming you can get around lack of semi-colons and parentheses. I also have Python installed on my server already and it still runs a Python script I made quite a while back, so I know I can reliably run it if I do decide to make an actual bot.
Now, how do I make the bot intelligent? Well, that’s a good question. I was thinking about making a giant Markov chain by feeding the bot top level high-rated comments for a while, then getting the bot to post (eventually) using my new Markov chain. The only problem with this is storage. Clearly that would take a lot of storage space, according to how most people make Markov chains.
Most Markov chain examples I found are like 2D arrays that contain the same data multiple times and randomly pick from one of those elements. I didn’t want to do that. I actually wanted to try to keep as much of my Markov chain in the database as possible so I didn’t have to worry about re-training my bot every time the script started…but how am I going to do this?
My database is going to be set up in a referential manner where words point to each other using IDs. Words will also have counters that indicate how many times they’ve been hit. I’ll pull this data into Python and run this bit of code I made for this reason:Error when loading gists from https://gist.github.com/.
That script loops through the sets that I just retrieved from the database, linking a word to how many times it’s been hit. This data is basically the percentage chance the word will be used next. Then it randomly picks the word and sends it back and the bot continues to build the sentence until whenever it decides it’s done, I guess.
Anyway, that’s about as much as I’ve got figured out right now. If you wanna know more, just ask in the comments. Sorry that you have to register to comment, by the way. Tons of spam bots hit my site now…
Thanks for reading!