

Discover more from pnote
Chelsea Hotel and the cartography of Leonard Cohen
šµ Using GPT to map geo references in songs
I love songs with a story. On my last trip to New York, the first place I went to see was a facade of a certain Manhattan hotel, just because Leonard Cohen wrote an (in)famous song about it. I remember you well from the Chelsea Hotelā¦
Itās a beautiful piece inspired by Cohenās relation with Janis Joplin. Itās about the power of art that transcends human imperfections (Weāre ugly, but we have the musicā¦). It also features a pretty specific account of physical affection that caused a minor scandal when the song came out.
I solemnly swear that I am up to no good
āChealsea Hotelā is a great song with a great story. But what if I didnāt know about it when I came to New York?
For traveling song geeks like me, it would be useful to have a map showing places of interest from songs we like, so that we can discover those places when we travel. Letās make one for Leonard Cohen!
Locating the songs
First, we will need the lyrics of Cohenās songs. These can be easily found online. A Python library lyricsgenius makes it easy to download them for local processing.
For each song, we will extract the geographical references from the lyrics. Similarly to our earlier experiment with theater plays, we can use a Large Language Model to help with that. The prompt I used this time goes something like this:
Identify geographic locations (places, towns, cities) referenced in the song lyrics below. If there are multiple places refenced, respond with a single place that is featured most prominently.
The response should be extremely short, just indicate the place, town and the country, for example: "Warsaw, Polandā or "Melbourne, Australia"
If there are no geographical references in the lyrics, respond with just "Nope"
It works! ā¬ļø
Results
In total the script processed 362 songs, including 18 with locations found and 344 nopes. A few of of them turned out not to be songs but poems (from Cohenās collection The Flame) which I manually filtered out.
GPT missed the somewhat hidden location reference in āSuzanneā. ChatGPT gets it right, but only if pressed with a little hint:
GPT: The song "Suzanne" by Leonard Cohen contains references to several geographical locations, but these are not precise towns or cities.
me: Try harder. What does "Our lady of the harbour" refer to ?
GPT: I apologize for the previous oversight. The line "Our lady of the harbour" in the song "Suzanne" by Leonard Cohen refers to the statue of the Virgin Mary that is often depicted as the protector of sailors. This location is likely Montreal, where Cohen wrote the song, and the statue might be referring to the Notre-Dame-de-Bon-Secours Chapel, commonly known as the "Sailors' Churchā
The total cost of all the GPT calls was $1.70 (I made ~5 GPT calls for every song as I was iterating on the prompt).
Cartography of Leonard Cohen
The resulting songs are few enough that I could put them on a map manually. See a published version here.
Itās a modest map, but the pipeline can be easily extended:
add more artists beyond Leonard Cohen
automate creation of the map, and maybe make it into a globe. Like in this project showing famous people born in each place around the world
In other news
š Catching up on the weird world of LLMs ā Introduction to Large Language Models like the one that identified location references in Cohenās songs for us. Recent and insightful
Going deeper on Chelsea Hotel: Jeffrey Lewisās šµ song about Leonard Cohenās song about Chelsea Hotel, probably NSFW
Postcard from Faroe Islands
Rare moment of sunshine in the remote archipelago of š«š“ Faroe Islands (autonomous territory of the Kingdom of Denmark). Itās cold and wet and very picturesque!
Have a great week š«,
ā Przemek