AI, spider, art

Monkey Chronicle

An Arts and Science project that gives the internet a voice

1.
Client Brief:

Based on the similar mathematical proof that when a monkey randomly hits the keys of a typewriter for an infinite amount of time, eventually he will reproduce the complete works of Shakespeare.

2.
Solution:

An AI-powered Python spider loads a page, picks a word to broadcast and then looks for links to continue its infinite journey.

3.
Result:

The texts generated by Monkey Chronicles are presented in a live stream on a website.

image

Let's write Shakespeare!

Giving the internet a voice.

Monkey Chronicles is an Arts and Science project based on the similar mathematical proof that when a monkey randomly hits the keys of a typewriter for an infinite amount of time, eventually he will reproduce the complete works of Shakespeare. Instead of searching if an Monkey Chronicles would reproduce an existing piece of literature, this project is aimed at producing new texts. By creating an infinite web spider that randomly picks a word from a website and then randomly selects a new link to visit from that website. The sequence of words that is automatically generated in this way forms the new text. We are deeply curious about the result of this experiment. The texts generated by Monkey Chronicles are presented in a live stream on the website (http://www.monkeychronicles.com/)

image

The approach

Making the spider more intelligent

It all starts with an initial website. This seed for the scraping process needs have a few external links to ensure we can crawl endlessly. The Python back end loads this page's HTML, finds all plain text that is part of the english language, and picks a word. A word is more likely to be picked if it is often found in combination with the previously selected word. Then we find all links to external websites, and follow one at random. If at any point there is a dead end because there are no english words on the page, the spider will backtrack until it finds more links to follow. All words are sent to a JS API. This small module stores the words into a Cloudant database, and broadcasts all words over a socket. This means the front end can easily display words as they are chosen. Additionally, the JS API also exposes a set of endpoints for external parties to use. They can request batches of sentences or get the most popular sentences.

Previous ProjectAll ProjectsNext Project