From Zitarrosa to natural language processing and ChatGPT
Word clouds, named entity recognition and TF-IDF applied to 202 songs by Uruguayan singer Alfredo Zitarrosa to see what he sang about and how his themes changed by decade.
Marking what would have been Alfredo Zitarrosa’s 87th birthday in March 2023, this article analyzes his lyrics with natural language processing: how many songs he released, which words and names appear in his work and what sets each decade of his career apart. It closes with lyrics generated by ChatGPT and the questions they raise.
TABLA DE CONTENIDOS
This article applies data science and natural language processing (NLP) techniques to 202 songs by Alfredo Zitarrosa: word clouds, named entity recognition and TF-IDF by decade. The exercise shows what can be extracted from any collection of texts, and it closes with lyrics generated by ChatGPT.
In March 2023, Alfredo Zitarrosa, once Uruguay’s most important musician, would have turned 87. To honor his memory, we at Quanam decided to write this article, using the technology tools we work with every day to analyze his vast and heartfelt body of work, 34 years after his death.
How the song collection was built
This time we focus on his lyrics, that is, on what his songs were about. As with any analysis of this kind, we first needed a data source. We collected Zitarrosa’s lyrics from this lyrics website, which compiles songs by many artists. The release year of each song was harder to get, since no website compiles that information, so each song’s year had to be recorded by hand.
The result was a respectable 202 songs written or performed by Zitarrosa between 1966 and 1989. A few clarifications: these are release dates; there are posthumous releases dated up to a decade after his death; and some songs could not be dated precisely because no record was found.
Zitarrosa’s career in numbers
With that in mind, we can look at Zitarrosa’s musical career in numbers, from his beginnings as a singer in the 1960s to his death, followed by the posthumous releases.
The numbers show that he was a very prolific artist during his active years: we counted 161 songs recorded before his death in 1989 (182 if we include the songs whose exact date we don’t know).
Word clouds: titles and lyrics
Along with the lyrics we also collected the song titles. Zitarrosa often named the rhythm in the title (milonga, chamarrita, zamba and other Río de la Plata folk forms); other times the title conveys the song’s feeling, and others simply name people, places or animals. From the titles we can build a word cloud showing the most relevant and frequent words.
We can follow the same process for the lyrics, again cleaning the text to remove very frequent but not very meaningful words (known as stopwords), such as some pronouns, articles and conjunctions. The result is a word cloud that sums up Zitarrosa’s entire body of work.
That word cloud reflects what Zitarrosa sang about, at least in terms of the topics he addressed most often.
Named entity recognition: who and what he mentioned
Another NLP technique we can use is named entity recognition, which detects the entities mentioned in a text, in this case the songs. Applied to his whole repertoire, it produces a representation of who Zitarrosa referred to in his songs.
The result is again a word cloud with a variety of elements: places and countries Zitarrosa mentioned, as well as iconic characters from his songs and figures of his time.
How his themes changed by decade: TF-IDF
Finally, we can look at how the themes of his work evolved over the years. They were clearly shaped by the historical moment he lived through, which led him to different experiences reflected in the lyrics he wrote or chose to perform. For this analysis we built separate word clouds for each decade of his career (the 1960s, 1970s and 1980s).
These word clouds give an idea of how the themes of his lyrics changed over his life as a singer. The country outlines used for each decade are not random: they correspond to some of the countries where he lived during that decade and where he created part of his work.
A technical note: filtering by date was not enough to build these word clouds. We applied a widely used NLP technique called TF-IDF, which identifies the most relevant words in each group (here, each decade) that set it apart from the rest. This way we largely avoided words that are typical of Zitarrosa’s work as a whole but not of a particular decade, which is what we wanted for characterizing each period.
What the analysis shows about natural language processing
From a technical point of view, all the techniques used, which fall within natural language processing, were useful in their own way for extracting different kinds of information from our documents (the songs). The analysis also shows that wherever there is text, in any volume and any context, these tools can extract information and help interpret the whole collection or any segment of it.
To close, although these techniques are often used to draw conclusions from large amounts of text, this time we chose to skip that step and leave it to the reader, because our subject is the work of Alfredo Zitarrosa, an artist who moved hundreds of thousands of people in different ways, and we prefer that each reader draw their own interpretation.
Bonus track: lyrics generated by ChatGPT
In March 2023, when we wrote this article, ChatGPT (based on GPT-3.5, an evolution of the GPT-3 generative model), one of the most powerful tools built in the field of NLP and generative AI, was already on everyone’s lips. So we couldn’t resist asking it for song lyrics written as if by Zitarrosa, about his country today. Would it do a good job? Would it sound like something Don Alfredo wrote? Would he write that if he were still alive? Could there be any use in “bringing him back” this way? Would it even be ethical? Once again, we leave those questions to the reader.
Prompt (in Spanish): Write me a song by Alfredo Zitarrosa about Uruguay in 2023
Lyrics generated by ChatGPT in Spanish, with the title the model gave them, “Dawn in Uruguay”. This is not a song by Zitarrosa. English translation:
In this dawn of Uruguay
that became what we dreamed of
you can feel the breeze of progress
bringing us new horizons.The traces of the past
have faded with time
and in every corner of the country
freedom fills the air.Equality is the watchword
and work our faith
everyone has their place
and together we can grow.Education is the key
that opens every door
and in every child and young person
the nation’s future is sown.In the Uruguay of today
the song of peace is heard
and every heart can feel
the pride of being Uruguayan.So let us raise a toast together
to the tomorrow that will come
because in this Uruguay of 2023
the future is our truth.
Iván Abatte
Data & Analytics Consultant