Data for humanistic inquiry
When we embed computer science in English, language, and arts classrooms, we introduce computationality in the service of humanistic inquiry. Questions of character, ethics, truth, justice, equity, and morality can be richly posed and explored with the help of computational methods. Here’s an example I have used with English teachers many times. In the chart in Figure 1, I offer two lines representing keywords from one of Shakespeare’s plays. The words are ‘love’ (the red line) and ‘death’ (the black line). The x-axis lists the acts and scenes in the play. The y-axis indicates the number of times the words appeared in each scene. Forget what play it might be; just look at the data.

Then ask yourself three questions. Firstly, what do I observe? Teachers will often observe that the frequency of the words have an inverse relationship. Love is way more popular in the beginning of the play; death is more frequently used in the latter half. Teachers will also often observe that in the third act, both words seem to be used more evenly. Secondly, based on your observations, what questions about the story emerge for you? Teachers have asked questions such as: What happens in Act 3 when the words are used with similar frequency? Do people die at the end of this play, because death is used far more often than love? What happens in the last scene that causes the use of the word love to surge one last time? Is there a wedding, or a funeral, or something else? Finally, what do you hypothesise about the plot and characters based on the data? Many rightly hypothesise that it is a nuanced love story that ends tragically, with some kind of important turning point in the third act. And if you guessed that it is Romeo and Juliet, in which Tybalt slays Mercutio and Romeo kills Tybalt in Act 3, you would be correct.
In this exercise, notice how computational methods (i.e. quantitative literary data visualised as a line chart) are used in the service of humanistic inquiry. In fact, readers can identify patterns in language and pose questions about a text using a data visualisation that they could not easily do if conducting a traditional close reading of the play alone.
Deepening our inquiries
Computational methods and quantitative data can help readers deepen and expand humanistic inquiry: deepen, because it actually forces us to look more closely at texts, and expand, because it offers new methods for doing so that complement existing practice. I taught Romeo and Juliet countless times as an English teacher. There is no realistic way to see patterns in the whole text at once as we do with the chart on the previous page. This method also provides myriad new points of entry for students to make meaning of the author’s work, while simultaneously building a critical and humanistic understanding of how quantitative data operates in the world.

You can even extend the above example to all of Shakespeare’s works at once. Instead of looking at scenes on the x-axis, we can look at acts in the play, because all of Shakespeare’s plays have precisely five acts. Look at Figure 2 for the frequency of love and death in all of his plays.
Again, what do you observe, inquire, and hypothesise? With just a quick glance, I observe that Hamlet has a similar pattern of frequency for our keywords. I wonder how Shakespeare’s use of the words compares across the two plays. Though they are both tragedies, I don’t think of Hamlet as a love story primarily, but rather as a tale of madness. I hypothesise that on rereading Romeo and Juliet, I might explore whether the protagonists’ affection for each other might be interpreted as an act of madness rather than frenetic teenage love. Does Shakespeare ultimately conflate love and madness? How do the actions of the star-crossed lovers compare to those of the Prince of Denmark? Those are valuable questions for students to pose, and ones that quantitative data and computational methods make it possible for us to identify and explore.
The pandemic has exposed our young people to the complex and sometimes traumatic relationship between digital data and lived visceral experience. In the coming months and years, our schools must help students explore what Covid-19 has heartlessly underscored: that the boundaries between numbers and letters, STEM and the humanities, and computers and human beings are falsely drawn. We must prepare students to contribute to the world in a way that sees the lives behind the lines on a chart, the human faces embodied in every data point. Computer science belongs in humanities classrooms because neither computers nor the sciences have very much value in the world unless they help us all understand and improve humanity itself — in the moment, and for generations to come.
Project ideas
Explore a book using literary data for yourself at helloworld.cc/plots.
When teaching poetry, try forefronting the concept of algorithms to explore with students how rhyme and metre serve as formulas poets use to increase literary effects.
Upload any text into Voyant Tools (voyant-tools.org) to explore its language use using visualisations. Just note that the literary data will not be organised by chapters or scenes, but rather general percentage.
Ask students to score each paragraph in a text for sentiment: negative (-1), neutral (0), or positive (1). Collect the data, calculate the average per paragraph, and create a simple line chart showing how sentiment rises and falls in the text. Finally, discuss what specific devices the author uses (such as the use of metaphors) to achieve this effect.
Give students an excerpt from a literary text with keywords blanked out. Using ‘if–then’ statements, ask them to explain what words the author could have used and what effect they would have on the reader. For example, “If the author uses ‘bloody’, she makes the reader cringe and worry. If the author uses ‘red’, the reader just keeps reading.”