Code as a Liberal Art, Spring 2024

Unit 2 Project

Assigned: Thursday, April 4

Due for in-class presentation, Thursday, April 18 (with 2-4 people presenting works-in-progress earlier on Tuesday, April 16)

Final draft of code: due in your Google Drive Folder on Friday, April 19, 8pm.

Submit a 250 to 300 essay. But rather than writing this short essay yourself, write an algorithm to generate it using a corpus that you collect and a Markov algorithm.

As background, you might refer back to Lesson 1 homework (question 4) and Lesson 2 homework (question 3) to consider a question that you might consider addressing with digital research methods. You might refer back to our discussions of the digital humanities to think about distant reading techniques and different ways that code can be used to analyze text. For this project, however, you will be using code to generate text.

  1. Start by making a new folder for this project. Within that, make a folder called corpus, and inside this collect a large body of text. You can collect text in multiple files, in which case your code will have to iterate over them all to process. Or you might manually merge all the text into one large file.
  2. Work with the code we developed together that generates a Markov data structure representing this corpus of text.
  3. Next, work with the code that we developed together that uses your Markov chain data structure to generate sentences.
  4. Run, test, tweak, and modify your algorithm until it generates a short essay that you are happy with. To submit, include the output from one run of this program that you are happy with, along with the code itself. I will be reading the text you submit and also trying to run your code myself.

    Include the text that you've generated in file called essay.txt and include it in your folder with your code. Upload this folder (which should also include your corpus folder) to Google Drive.