Code poetry. Computational creative writing. Digital poetics. Electronic literature.
All of these names refer to creative manipulation of words with computer code.
This workshop will serve as an introduction to natural language processing, with a focus on creative applications of the technologies introduced. The first part of the workshop will provide a crash course in Python basics, including the syntax and features that make the language a popular choice for handling, analyzing, and manipulating text. The rest of the workshop will focus on Pattern, a powerful Python library for natural language processing, as well as other tools and resources available for creative text manipulation.
Topics covered will include (but won't be limited to):
- Word tokenization
- Markov chains (Ngram generators)
- Sentence parsing / part-of-speech tagging
- Sentiment, mood, and modality analysis
- Stop words and stemming
- Term Frequency-Inverse Document Frequency (TF-IDF) analysis
At least some minimal experience with programming (in any language) is recommended.
In addition to a text editor (I recommend Sublime Text), please ensure your computer has Python installed. You can verify this by entering "python" (without quotes) in the Terminal. If, for some reason, you find that you do not have Python installed, please follow the instructions for installing version 2.7.9 at python.org. (Don't install Python 3.)
You'll also need to install pip, the Python package manager. On Mac, run the following command in the terminal to do so: $ sudo easy_install pip
Finally, use pip to install the virtualenv library (its purpose will be explained at the beginning of the workshop): $ sudo pip install virtualenv
- Pentametron by Ranjit Bhatnagar
- The Deletionist by Amaranth Borsuk, Jesper Juul and Nick Montfort
- Metaphor-A-Minute by Darius Kazemi (founder of NaNoGenMo)
- I Waded In Clear Water by Allison Parrish
- World Clock by Nick Montfort
- Patent Generator by Sam Lavigne
- The Cut-Up Method of Brion Gysin by William S. Burroughs
- Oulipo
- The Policeman's Beard is Half Constructed by RACTER
$ python
>> print "hello world!"
...
>> import this
...
Make a folder, cd into it in Terminal, and clone this repo inside the folder:
$ git clone https://github.com/rossgoodwin/itpcamp.git
Now make a new virtual environment:
$ virtualenv env
$ . env/bin/activate
$ pip install "ipython[notebook]"
$ ipython notebook
- WHITESPACE!!!
from __future__ import braces
- Variables
- if / elif / else
- Loops
- Functions
- Classes & objects
- Libraries
- Strings
- Lists
- Dictionaries
- Sets
- Tuples
a,b = b,a
- Formatting strings
"testing %i, %i, %i!" % (1, 2, 3)
- List and dictionary comprehensions
- Important Keywords
- in
- lambda
- try / except
- with
- yield
- Code Like a Pythonista
- Allison Parrish's course materials, GitHub repo, and resource list
- List of Procedural Generation Tutorials