TITLE: Story Mashup
CATEGORY: Natural Language Processing (NLP), Computational Literature
DATE: October, 2015
Story Mashup was an experiment in generating what I hoped would be at least semi coherent stories from two unrelated sources of text. All the language processing happens on the client-side. Although I preloaded several sample texts, the user is able to paste in text of their choosing for one, or both, of the sources. The main script splits each sample text using regular expressions (regex) and makes a call to the RiTa API for each word, which returns the associated part-of-speech tag. Each source is converted into a dictionary of key-value pairs; using the part-of-speech tags as keys. Before the user clicks the 'Jumble' button, they have the option to choose the weighting each source will bare on the result - by means of a slider. If the user decides on a weighting of 70:30 in source A's favour, it will use source A as the base and replace roughly 30% of the text by substituting words from source B's dictionary with matching parts of speech, before displaying the result in the browser. While the results are often not as coherent as I'd hoped they'd be, they are nevertheless often very amusing. I feel the results can be improved significantly by switching to a more effective NLP library, and by employing markov chains to generate the text.
URL: View the live project ( HERE )
CODE: Github Repository
For the sample source texts, I chose a combination of children's stories, science fiction short stories, biblical stories, and erotic fiction. Below are some of the more amusing results I got during testing: