Working with JSON, RiTa, and Lincoln

So, this week, I spent a lot of time watching videos, following along with tutorials and scratching my head more than I’d care to admit. Rather than having one nice, clean experience to share with you, I have a bunch of small working parts and sloppy Franken-code.

Across these experiences, I worked mostly in p5.js. In addition to following along with the fetch() and async/await videos, I did the coding follow-along exercises associated with the video on JSON (Data & APIs), then kept going to learn how to make a map using Leaflet–which was on my wishlist of things (pertaining to APIs) to learn about!

Screen Shot Playing with Leaflet.js and APIs
Screen Shot – Playing with Leaflet.js and APIs – plotting the current location of the ISS.

After working through the instructional material a bit, the first sketch I tried on my own involved loading JSON into a p5.js sketch. I picked the JSON list of US Presidents as a source file from Corpora’s data Github repository because, of course, I’d go for the ‘humans’ category after this week’s reading… more on that later, though. Not really having worked with JSON files with such layers of depth of data, I had a hard time getting the results I wanted.

Ultimately, I learned about (well, at least got more experience with) how to dig into deeper layers of JSON data content. Here is the resulting sketch–an alphabetized list of last names of US presidents, with each president’s term earning his last name another spot on the list. I also got practice with pushing JSON items onto an array and then displaying that array as a joined string. (Sadly, while the theme of this post was meant to be, “I played for hours with this and am done (for now), here’s what I learned”, I spent another 30 minutes just now trying to get the items in the array to display without commas.)

Screen Shot p5.js Sketch Displaying an Array in the Console of Presidents' Last Names Loaded from JSON File
Screen Shot p5.js Sketch Displaying an Array in the Console of Presidents’ Last Names Loaded from a JSON File courtesy of Corpora via Github… baby steps!

I also followed along with the RiTA.js tutorial on the syllabus to replicate the “dark and stormy night’ sketch, then failed miserably when I tried using the library to swap out different parts of speech of an Abraham Lincoln poem. I will say that I did re-learn a bit about looping through different parts of arrays, but, ultimately, ended up with a bunch of repeating nonsense. This was a bit disheartening considering how well my other coding projects have been going lately. I was really starting to think I had the hang of things–I probably do (at least, more than I think.)

Screen Shot p5.js Sketch Displaying a List of Presidents' Last Names Loaded from JSON File
Screen Shot of a p5.js Sketch Displaying a List of Presidents’ Last Names in Alphabetical order, loaded from a JSON File courtesy of Corpora via Github

For this assignment we were asked to read the article “The Politics of Images in Machine Learning Training Sets” from the site Excavating AI and then to reflect on the implicit biases that may be affecting the data we worked with, and, in turn, this week’s projects. Unfortunately,  the bulk of what I focused on was loading and accessing the data, so I didn’t really have a ton of output that was much more revealing of biases than what I started with; however, it’s nonetheless worthwhile to take a look at.

Because I kind of pivoted from my first project (JSON file with US presidents’ names) to my second (trying to use RiTa to change a poem written by a US president), the two projects I spent the most of my time on have a common thread; I think it’s clear that there are some glaring commonalities among who appears in the data for US presidents. All are Christian men who, with one exception, identified at caucasian. All of them were over the age of 35. And, according to a list of common traits of US presidents I found online, most were college educated–in fact, most were lawyers–and 4/5ths had a net worth of over $1M in today’s money.

Screen Shot of the Library of Congress' Page for Abraham Lincoln's Poetry`
Screen Shot of the Library of Congress’ Page for Abraham Lincoln’s Poetry. Who knew?!

I also found the poem from Abraham Lincoln interesting. It was written in 1858 to the daughter of a man at whose hotel Lincoln stayed while on a speaking tour; from what I can gather, Lincoln would have been running for president around the same time. It is a personal poem encouraging Rosa to grow and blossom before she ages and ‘fades’. In the poem, it mentions that he’s giving advice to her–as an older man to a young woman; however, in my mind, it makes me think of a male customer in today’s society telling a younger female checkout clerk to ‘smile.’ I’m sure back then the context was very different, but it’s still important to be aware of such implicit cultural norms when looking at things from today’s (or, frankly, any) perspective.

If you’re curious, here’s the text of the poem:

To Rosa—
You are young, and I am older;
You are hopeful, I am not—
Enjoy life, ere it grow colder—
Pluck the roses ere they rot.

Teach your beau to heed the lay—
That sunshine soon is lost in shade—
That now’s as good as any day—
To take thee, Rose, ere she fade.

In terms of use and abuse, I’m not sure that with this data there’s a ton that’s obscured enough that these are the primary concerns. What’s a greater potential concern is the idea that these faces–of American presidents–would be seen as a product of living in a meritocratic society. If younger people were to see these names, along with the faces and bios that go along with them, and believe these people got to where they did because of merit alone, it would be a great injustice to our youth and future of our society. These men are not representative of most of our nation or its values as a whole, but, rather, are/were members of privileged classes that aided them in ascending to such a powerful position. The dangerous part in this data set is forgetting that.

Leave a Reply