# Verse1-Chorus-Verse2 Structure: A Stacked Ensemble Approach for Enhanced Music Emotion Recognition
## 2 Methodology
### Establishment of Dataset from Emotion-Labeled Spotify Playlist  
At the heart of music lies the harmonious interplay of two vital elements: audio and lyrics. Audio encompasses the instrumental and vocal arrangements, while lyrics convey poetic expressions, emotions, messages, and narratives. In this study, we manually gathered a dataset comprising 400 samples of raw audio and lyric data. Before the collection of data samples, preliminary activities were conducted that involved using and extracting Spotify Playlists titles that contain the words for the four basic emotions from [PERSON]'s emotion plane as mentioned by [27]: angry, happy, sad, and relax, respectively. Additionally, the extraction of playlist titles included synonyms of these four basic emotions to ensure comprehensive coverage. The collection of playlist titles was then subjected to a meticulous cleaning process to exclude those playlists containing instrumental music, music that lacks lyrics, playlists tailored for gym or yoga classes, for this may contain a mixture of audio instructions not lyrics, and non-English songs to ensure consistency in the linguistic context of our dataset. Furthermore, to ensure accuracy inemotion labeling, we adopted a methodology where songs appearing in more than two playlists were considered for inclusion. Subsequently, raw audio wav data and lyric data were extracted from online platforms, and feature extraction was performed on both types of data. For audio data, the following features, including chroma, tempo, 20 mel-frequency cepstral coefficients (MFCC), zero crossing rate (ZCR), spectral bandwidth, spectral centroid, root mean square value, and roll-off, were automatically extracted using the python Librosa Library. These audio features were utilized as they were claimed, in the study of [13; 14; 15; 16], to have an impact on the recognition of emotion in music. Two additional features were also included, namely the emotion label and its filename. Meanwhile, lyric data underwent term frequency--inverse document frequency extraction (TF-IDF) using the Natural Language Toolkit (NLTK) Framework-coupled with stopword removal and removal of punctuation and symbols for cleaning purposes. The final step involved segmenting the dataset into verse1, chorus, and verse2 sections, storing audio and lyrics features separately in comma separated value (CSV) files as shown in Figure 1. These meticulous procedures were executed to establish a comprehensive and enriched dataset, facilitating in-depth exploration in the field of music emotion recognition. Table 1 provides an overview of the raw datasets that were created in this study. The \"Song Part\" column represents different parts of the songs, namely Verse 1, Verse 2, Chorus, Whole Song, and a combined sequence of Verse 1-Chorus-Verse 2. Features for these \"Song Parts\" were manually extracted from segments that contain both audio and lyrics data. Furthermore, each of these parts was extracted to compare the performance of deep learning models, as they will be fed individually into the model. The column \"Audio Features\" details the structure of the audio dataset, which comprises audio features and is represented by the notation (total number of songs/audio tracts, total number of audio features) vector. For instance, the value (400, 29) indicates 400 songs/audio tracks, each characterized by 29 distinct audio features. These audio features include chroma, tempo, 20 mel frequency cepstral coefficients, zero crossing rate, spectral bandwidth, spectral centroid, root mean square value, roll-off, emotion label, and the corresponding filename. The audio features for Verse 1-Chorus-Verse 2 display different values that present the sum of all features across these specific parts of each song. The columns \"Document Frequency\", \"Unigram\", and \"Bigram\" are parameters utilized in the extraction of lyric features using the TF-IDF algorithm. \"Document Frequency\" indicates the minimum number of documents in which a term appears within the dataset.