Skip to content

Bot generated from a markov chain of everything George Costanza says in Seinfeld

Notifications You must be signed in to change notification settings

bertrandom/costanzabot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

costanzabot

Bot generated from a markov chain of everything George Costanza says in Seinfeld

Usage

./test.rb will spit out an example tweet.

How this particular sausage was made

or "instructions for Future Bert if he wants to do this again".

This was mostly just an excuse to play with twitter_ebooks.

First, start with seinfeld-scripts.

Next, patch it with this fix.

mkdir scripts
./download.sh scripts

Edit scripts/01.shtml and change pc: 101, season 1, episode 1 (Pilot)<br> to pc: 101, season 1, episode 0 (Pilot)<br>.

./run.sh

This will create an sqlite database called seinfeld.db.

Extract everything that George says into a text file:

sqlite3 seinfeld.db "SELECT sentence.utterance_id, sentence.text from sentence, utterance WHERE utterance.speaker = 'GEORGE' AND sentence.utterance_id = utterance.id;" > export.txt

Move export.txt to the seed directory of this repo.

Join the utterances into single lines of text with the parsing script:

./parse.rb > costanza.txt

Create a skeleton for the bot.

ebooks new costanzabot

Move costanza.txt into the corpus directory.

Consume the lines into a Markov model:

ebooks consume corpus/costanza.txt

About

Bot generated from a markov chain of everything George Costanza says in Seinfeld

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages