Control Room Omar
Menu

Case Study

The Evolution of Arabic Music Lyrics: A 50-Year Computational Analysis

Analyzed 561 songs over five decades using NLP to track sentiment and linguistic shifts in Arabic music.

2023-10-27 Digital Tools & Analysis University
Cover for The Evolution of Arabic Music Lyrics: A 50-Year Computational Analysis

My Role

Lead Researcher and Data Engineer responsible for the end-to-end pipeline, including data scraping, preprocessing, and sentiment analysis.

Outcome

Identified significant shifts in sentiment and linguistic content, correlating music trends with regional cultural changes.

Tools

Python Pandas Scikit-Learn Spotipy CAMeL Tools

TL;DR

This project provides a longitudinal analysis of Arabic music lyrics spanning five decades (1970s–2020s). By leveraging Natural Language Processing (NLP) and automated data scraping, I analyzed 561 songs to quantify shifts in sentiment, the prevalence of explicit language, and the correlation between popularity metrics and lyrical content. The study successfully mapped how regional cultural shifts—such as the rise of Mahraganat and modern rap—have fundamentally reshaped the linguistic landscape of Arabic music.

Problem

While music serves as a primary cultural barometer, the evolution of Arabic lyrics has remained under-explored through a computational lens. There was a lack of empirical data to quantify how sentiment and “edginess” in lyrics have evolved over time. Specifically, it was unclear how modern movements emerging in the 2000s influenced the frequency of offensive language and the overall emotional tone of popular music across the region.

A map highlighting the Middle East and North Africa (MENA) regions to illustrate the geographic scope of the study's data collection.

Design Iterations

The project evolved from a baseline sentiment analysis into a multi-dimensional data engineering pipeline:

  1. Data Acquisition: I developed a custom scraper utilizing Spotipy to extract metadata (popularity, release year) and Genius.py to fetch raw lyrical content.

  2. Preprocessing Pipeline: I implemented a robust cleaning script (Data Processing.py) designed to handle Arabic-specific linguistic challenges, including the removal of Tashkeel (diacritics), punctuation normalization, and the unification of visually similar characters (e.g., “ة” to “ه”).

  3. Analytical Layers:

    • Sentiment Analysis: Utilized the CAMeL toolkit to categorize lyrics into positive, negative, or neutral sentiments.
    • Linguistic Filtering: Engineered a custom filter to detect and categorize 245 specific offensive terms.
This graphic symbolizes the filtering of edgy content, representing the logic used to identify and categorize censored or offensive language within the dataset.
  • Trend Mapping: Correlated these findings with Spotify’s popularity metrics to determine if “edgier” content correlates with higher engagement levels.

Technical Details

The backend architecture was built primarily in Python, utilizing a modular design to ensure scalability and clarity:

  • Data Engineering: Employed pandas for complex dataframe manipulation and the csv module for structured data storage between processing stages.
  • NLP Pipeline: Integrated camel_tools to achieve high-accuracy sentiment analysis tailored specifically for Arabic dialects.
  • Automation: Automated the collection of 561 tracks by iterating through yearly intervals (1970–2023) to ensure a consistent and representative longitudinal sample.
  • Feature Engineering: Developed a “Popularity Score” metric to analyze the growth of music distribution in tandem with the evolution of lyrical content over time.

Results & Key Metrics

The following visualizations illustrate the core findings derived from the analysis:

This pie chart illustrates the geographical distribution of the 561 analyzed tracks across different Arab nations, highlighting the diverse regional scope of the study's data.

The analysis yielded several high-impact findings:

  • Sentiment Trends: While positive sentiments generally outpaced negative ones, the data revealed a distinct shift in lyrical tone beginning in the early 2000s.
A line graph illustrating the distribution of sentiment categories across five decades, highlighting the significant peak in positive sentiment around the year 2000.
  • Offensive Language Spike: A significant increase in offensive language was detected starting in the 1980s, peaking sharply in the 2010s—a trend that correlates directly with the rise of Mahraganat and modern rap movements.
This line graph illustrates the longitudinal data for the percentage of songs containing offensive words from 1970 to 2020, highlighting significant spikes corresponding to shifts in musical genres.
  • Popularity Correlation: Spotify data confirmed a massive surge in popularity scores after 2000, coinciding with the diversification and increased “edginess” of lyrical content.
A line graph illustrating the longitudinal growth of song popularity scores from 1970 to 2020, highlighting the significant upward trend starting in the early 2000s.
Frameworks & Tooling