Skip to content
Project to design a twitter bot that uses natural language generation to create “fortunes” like you’d find in a fortune cookie
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a project to make a twitter bot that uses natural language generation to create "fortunes" like the kind that you'd find in a fortune cookie. is the driver of the program
It authorizes itself with twitter, builds the model from the corpus, then runs the main loop:
-check if enough time has passed to tweet. If it has:
	-spit out a new tweet generated by the model
	-figure out how long to wait until tweeting again implements a State Transition Table
Basically it can be thought of as representing a finite-state automaton
This forms the backbone of the proceding models, which differ mainly in how they actually interact with the STT implements a regular Markov Chain
It maps singular words to singular words and generates snippets one word at a time implements a slightly more sophisticated model called an Additive Markov Chain
It maps pairs of words to singular words. It generates snippets one word at a time, but based on the last TWO preceding words instead of one
It can produce more comprehensible snippets, but it needs a quadratically-scaled corpus to maintain the level of connectivity of an ordinary Markov Chain
To deal with the corpus problem I've started working on a method of generation with built-in mutation in tandem with a training suite for quickly generating and reinforcing snippets.

test_* scripts are for testing the code in the corresponding files implements some functions for manipulating text implements a suite for training and saving a model

Stuff I may want to implement later:
- let people tweet pictures of fortunes to the bot, then have it read them and add them to the corpus
- reinforcement learning based on which tweets people like or retweet
- beam-search based algorithm. Instead of performing a single random walk through the graph, generate a small collection of snippets and then judge the best one based on some probabilistic criteria
You can’t perform that action at this time.