Experiment 3: Markov Chains

I thought it would be interesting to use a markov chain to generate some predictive text. For this week's experiment, I decided to gather my personal messages and see what predicative text would be generated based on those personal messages.

In order to do this, I downloaded all my Facebook Messages and cleaned my conversations up. I went through all the json files and copied all the messages that I sent to a csv file. Now that I had all my messages, I implemented a markov model using Markovify (https://github.com/jsvine/markovify). Next, I used Flask to create a web server and hosted it on Amazon Web Services (specifically, Amazon Lambda - to make a serverless web application). Then, I generated a phone number using Twilio; my goal was to allow someone to text the number and get a reply back with a 200 character response of something I'd say. I used the API endpoint generated by Lambda as a webhook for the Twilio SMS API. If you text 631-318-6563, you'll get a text back with something I'd say that was generated using a markov chain. I am using Twilio via a trial account, so only approved/verified numbers receive replies, unfortunately. The reply messages are very interesting, though! For some examples of replies, visit: https://jb2du5s042.execute-api.us-west-2.amazonaws.com/dev.

Comments

Popular posts from this blog

Assignment 9

Final Project Update

Experiment 6