Rationale
We recently finished our reading of the first volume of The Complete Peanuts. We’ve read some of it closely thanks to your daily comics discussions, and we’ve gotten an even closer look at a subset of those strips as we’ve marked them up with TEI and CBML. With all of this behind us, I’m guessing that we could offer some pretty in-depth takes on what Peanuts is “about.” And yet, we have only read 4% of his 17,897 strips. So any pronouncements about what Peanuts is “about” at this point would necessarily require ignoring most of the available evidence.
Fortunately, digital humanities methods offer us, as Robert K. Nelson writes, “an additional method that allows us to examine and detect patterns within not a sampling but in the entirety of an archive.” One of these methods is topic modeling. From our reading, we know that topic modeling is, as Megan Brett puts it, “a way of identifying patterns in a corpus” by using an unsupervised machine-learning process to find “recurring pattern[s] of co-occurring words.” In other words, topic modeling should help us discover some of the underlying discourses within the whole Peanuts corpus, that thing we could never, ever read in a regular semester.
Of course, it needs to be said that topic modeling works with text and text only. And, as we all know at this point, Peanuts is about so much more than dialogue and diegetic text. This method cannot even pretend to account for the visual aspect of Schulz’s work. Nevertheless, in our quest to understand Peanuts—and especially how it might change over time—topic modeling provides us with a chance to consider patterns of linguistic affinity and difference that are invisible simply because of their scale. In short, while we know that topic modeling cannot be the final word about Peanuts, it’s still worth a shot!
Nitty Gritty
For this assignment, you will collectively produce several topic models of the text of Schulz’s strips and begin the process of analyzing them. The assignment has one outcome: a collaboratively written Google Doc. This Doc is due at the end of class on Tuesday, 8 March.
Step One: Get the Data
You can find the cleaned GoComics Peanuts data in our repository in the gocomics/peanuts-clean folder. Please remember that these data are copyrighted: while we are using them in a fair-use context (a research project and an educational experience), they should not be distributed outside of the class.
Step Two: Predict the Data
Spend a little time thinking about what you’re likely to see in your topic model. Jot down your thoughts in a shared Google Doc (see Step Six) so you don’t lose track of them. In many ways, this is sort of like the “hypothesis” step in that science project you did in middle school.
Step Three: Model the Data
Using MALLET and the Step-by-Step Guide to Topic Modeling, collectively make at least 6 different topic models of the corpus. Experiment with changing some or all of the following:
- the number of topics
- using and not using stopwords; consider whether you need to supplement MALLET’s default stopword list (viewable in the MALLET directory > stoplists > en.txt) with an additional stopwords file, such as character names.
- the number of iterations you run
- whether or not you use the
--optimize-intervalsetting
Make sure that you keep careful records of the different commands you use to create each of the different models.
Step Four: Analyze the Data
After making each model, look at the topic keys to see if there seem to be too few topics or too many. Too many topics tend to be easier to spot since you will have two or more topics that look relatively similar to one another. For example, if you have three “baseball” topics, you should probably model the data with fewer topics. Too few topics can be spotted by there not being especially clear patterns to the topic keys. (That said, since we are working with relatively small documents rather than academic articles—which is what topic modeling was designed around—the appearance “clear patterns” is not guaranteed.)
When you have a model with topic keys that seems workable, open the topic composition file in Excel. Insert a row at the top of the spreadsheet and name the columns to make them easy to work with. See which documents (AKA strips) rank high for the various topics. Do you see any patterns based on the year the strips are published in? Is there one topic that seems to be high for a lot more strips than you would expect? (This often happens and represents what I sometimes call the “English language” topic. This becomes easier to spot if you’ve used the --optimize-interval command.)
Outside of Excel, ask yourself which topics you are seeing that you had expected, which topics you hadn’t expected to appear, and which topics are “missing.” Consider which character names are prevalent in particular topics. Observe which words appear in multiple topics.
Step Five: Visualize the Data
Each of you should pick a favorite strip from the ones you selected for our daily discussions. Then, collectively, do one or more of the following:
- Using the six strips you collectively chose, make a pie chart for each of the strips, showing which topics comprise the strip using Excel and the guidelines in Miriam Posner’s “Very basic strategies for interpreting results from the Topic Modeling Tool“
- Using the six strips you collectively chose, Identify the three most prominent topics for each strip, according to your model. Using the topic keys, color-code the terms in the strip that come from each of these three particular topics.
- Using an entire model, ask me to prep your data for network visualization in Gephi (or run
mallet2gephi.pyyourself from thescriptsfolder in our repo). - Using an entire model, ask me to visualize your models over time (or run
topics-over-time.pyfrom thescriptsfolder in our repo).
Step Six: Write about the Data
Write about your hypothesis, modeling, and analysis using Google Docs. When you are done, share it with b [dot] croxall [at] gmail [dot] com. The post is due by the end of class on Tuesday, 8 March. Your write-up should contain the following information:
- Your hypotheses that you made in Step Two
- A list (bullet points are fine) of the different models you tried. This might look something like, “20 topics, no stopwords, 1000 iterations, no optimization”
- Identify which of the abovementioned models you think is best for Schulz’s work and discuss why you made this decision.
- Write a minimum of 3 paragraphs to report on what you observed in Step Four.
- Include the visualizations that you produced in Step Five.
- Each of you should individually write a paragraph that discusses what you learned from this approach that you didn’t learn through reading the strips or marking the strips up.
Grading
This assignment is worth 50 points. You will be graded on whether your Doc has all the required items; the quality of the work that you did in trying and evaluating different models; and your analysis of the models that you create.
Credits
This assignment was designed in 2018 and owes debts to Miriam Posner and Lisa Rhody for their ideas for visualizing the output of a topic model. In 2019, I simplified portions of the assignment based on what I learned the previous year. In 2020, I adapted the assignment for Peanuts, and I’ve updated it each year since.