I combined a few of my favorite things, mainly hacking, python, natural language, and of course, Zoolander, and it makes for some fun output.
One of my favorite features of nltk is the concordance function, which basically shows the context in which a given term is used. It is referred to early on in the nltk book and never fails to provide entertaining output(hint: see how the word kill lines up?):
A quick Google search yielded the Zoolander script here. From there, I copied and pasted the text and saved it as zoolander.txt.
Sprinkle in a little bit of simple python:
Here is the output for a few terms, as listed in the source code above.
See? Fun indeed. Next post, we’ll generate some random text based on lines from the movie.