Fall 2025 · HUMA5630 · NER · GIS
Geographical Preferences in Cantopo Lyrics of Albert Leung (林夕)
Albert Leung wrote more than a thousand Cantopop lyrics. This project reads every place name in them, and finds that two places do almost all of the work.
- Japan · the distant
- Hong Kong · home
the distant
Japan
Travel, distance, the elsewhere: the address a song goes to when it wants to leave.
- red markers on the project's map
- lyric snippets in each pop-up
home
Hong Kong
The domestic register: the address the same songs come back to.
- amber markers on the same map
- the same pop-up pattern
method
- 01Tag 40 Cantopop songs that name places, and convert them into BERT's input format
- 02Scrape and clean more than 1,000 Leung lyrics from Feitsui Lyrics
- 03Fine-tune BERT-Base-Chinese line by line, then count the entities it returns
- 04Chart the counts, the word cloud, and an interactive map with lyric pop-ups
Digital Humanities Student Project (Fall 2025). This project is a course project for HUMA5630 Digital Humanities.
Photo of Albert Leung, provided by the project author
About This Project
Albert Leung (林夕) is arguably the most influential lyricist in the Chinese pop music, whose contemporary urban lyrics have shaped timeless classics for renowned artists. His unique talent for linking abstract emotions to tangible physical spaces led to our research. In past, some scholars have previously analysed the nature of words, emotional words, and time words in Albert Leung’s lyrics, but there has been no analysis of the specific locations.
Thus this project applies Named Entity Recognition (NER) to analyse geographical imagination in over 1000 Cantopop lyrics of Albert Leung, investigating how he constructs distinct emotional spaces through geography—specifically the dichotomy between Japan (The Distant/Travel) and Hong Kong (The Domestic/Home).
Methodology
- Prepare training data: Create a training data comprising 40 representative songs that feature locations by other Hong Kong lyricists. This dataset was split, tagged and converted to BERT’s input format, using a Bert-base-Chinese model for fine-tuning.
- Prepare predicting data: Collect a testing data of over 1,000 Cantopop Lyrics of Albert Leung (林夕) via Python-based web scraping on Feitsui Lyric (https://www.feitsui.com) and then clean the data to remove irrelevant content, aiming to retain only the actual lyrics.
- Fine-tuned NER model with training data: Segment the testing data uses line-by-line processing.
- Visualization: Count the recognized entities and do visualization based on preliminary analysis, including a bar chart, a word cloud and a map.
Figure 1. Word Cloud
Key Features
- Robust Web Scraping: A scraper designed to fetch lyrics from Feitsui Lyrics, featuring automatic retry logic and content cleaning (removing Pinyin/English).
- Named Entity Recognition (NER): Utilization of BERT-based models to extract location entities from unstructured text.
Figure 2. Place Name Frequency
- Data Visualization:
- Statistical Analysis: Bar charts illustrating the frequency of top locations.
- Word Clouds: Visualizing the “geographic atmosphere” of the lyrics.
- Interactive GIS Mapping:
- Integration with Google Earth for precise manual geocoding.
- Generation of an Interactive Web Map using Folium.
- Color-coded Clustering: Red markers for Japan (Travel) vs. Orange markers for Hong Kong (Home), complete with lyric snippets in pop-ups.
Tech Stack
- Language: Python 3.10+
- Data Acquisition: requests, BeautifulSoup4
- Data Processing: pandas, re, xml
- NLP: transformers (Hugging Face), jieba (optional)
- Visualization: matplotlib, seaborn, wordcloud, folium
- ZHENG Xin — MA Chinese Culture
- CHEN Zihui — MA Chinese Culture
- YU Liangliang — MA Chinese Culture
- LU Zisheng — MA Chinese Culture
GitHub Repository
Please find the detailed code and project documentation at the link below.
the reading
He ties an abstract feeling to a concrete address, and the two addresses he uses most are the one he travels to and the one he comes back to.
the project's reading of the corpus
