Blog Post

DH Lesson Plan: Algorithm Creation and the Black Box

I wanted to share a really successful lesson plan that I used in my Introduction to Digital Humanities class this semester.  I used it as part of a class on multimedia and robotic writing, but it’s a very useful exercise to encourage students to start thinking critically about the way that information is structured, organized, and found no matter what the class’s content is.  During this class, I emphasized the idea that when we’re doing DH work or looking at a multimedia archive, we’re not thinking about how knowledge is organized, but about how meaning is organized.  Joseph Byrne talks about this in his explanation of the Blake Contraries Game, a website I used to talk about the way that multimedia works.

The purpose of this lesson plan is for students to start thinking critically about the “black box” even if they don’t know how to program.  It comes in handy later when students need to start putting together their own databases or corpora for a final project.  We type a search word into Google, or we run some data through a text analysis tool, but what happens there is a mystery, one that Digital Humanists encourage us to get to know and be critical of.  But this can be a difficult thing to teach humanities majors how to do in an intro-level class.  My goal was to come up with something simple and approachable but that had a big impact.  The outcome of this lesson plan is that students will know from experience the kinds of choices that go into creating an algorithm that runs the tools they’ll later use.  They’ll at least know that there’s something they need to investigate later down the road.

For this activity, I used OULIPO’s N+7 formula to rewrite a poem.  Any poem will work.  I used Yeats’s “The Second Coming” because it has a few tricky parts, and conveniently, it has 22 lines for my 11 students.  Before I started the activity, I showed students the poetry generator on the website Language is a Virus.  The computer generates new poems that all make some kind of syntactical sense (if not any other kind of sense), but it's not apparent how the computer is doing it.  As I clicked the “generate new poem” a few times, I asked students to start looking for patterns.  Soon, they noticed that the poems all had the same basic structure and that new words remained the same part of speech as the word it replaced.  Sounds simple enough, they agreed; what’s the big deal?  From there, I explained that someone had to program an algorithm to recognize each word’s part of speech and then replace that word from a giant bank of words it already had.  The computer wasn’t just pulling words from thin air; it was pulling words from a list that it already had, a list that required someone to make decisions about the words that would go in it.  We noticed that the bank for this poetry generator was limited, and some words would repeat as we kept generating new poems. (As a foundation for this exercise, students were assigned to read William Winder’s “Robotic Poetics” in Blackwell’s Companion to Digital Humanities.) From there, we could move on to the activity that illustrated how these decisions are made.  At this point, students were wondering: OK, so someone made a list of nouns and verbs.  Again, what’s the big deal?  

The rules of N+7 are that every noun must be replaced with the 7th noun that follows it in the dictionary.  I gave two lines to each student and said, “go.”  Immediately, as I had hoped, everyone started asking questions about more rules they had to make to ensure there would be consistent results across each line.  What dictionary should we use?  How do we find that dictionary?  How do we find a page in the (digital) dictionary that will allow us to see the 7th noun?  Once we figured that out, the questions started getting more complex.  Shouldn’t we make rules about what kinds of nouns need to be changed?  Do we change “blood” in “blood-dimmed” (l. 5), or do we treat that as a part of a unit that is actually an adjective?  What about Spiritus Mundi (l. 12), especially if we can’t find it in the dictionary?  As students asked these questions, they were starting to see the difficult decision making process that goes into programming, and they were starting to understand that there’s no one way of writing this formula; there were several routes that they could take while still following the rules.  

Once everyone had a chance to rewrite two lines from the poem, everyone read his lines out loud.  As this happened, I stood at the whiteboard and crossed out the words that they replaced.  (I just projected the poem on the whiteboard and crossed out the images on the whiteboard.)  When we took a moment to analyze the final product, more difficulties came up, and we noticed mistakes that we would need to go back and edit; we also noticed that we might have needed to decide on new rules based on some discrepancies that came up.

This ended up being a really fun class where students realized that they were taking a lot for granted.  Some came away with a new understand of what multimedia is and does, and most left with a new understanding of all the decisions that go into the black box of Digital Humanities tools.  Success!

81

2 comments

Hi Erin -- this sounds like a great approach to understanding some key programming logic without getting too detailed. I like the idea of pairing it with poetry in particular because of the structure and limitations that are all a part of the logic for both the literary form and the algorithm. It's really important to make programming concepts more accessible to non-tech people, good work!

50

It is a challenge to introduce non-tech humanities students to programming, and this was a good way of also using my own expertise to teach something different.

45