CLASSIFICATION OF SONG MOOD BASED ON LYRIC ANALYSIS USING TF-IDF AND SUPPORT VECTOR MACHINE

Authors

  • Zulfan Januardi Adha Lancang Kuning University, Pekanbaru, Indonesia
  • Muhamad Rafi Irhab Lancang Kuning University, Pekanbaru, Indonesia

Keywords:

song mood classification, lyric analysis, text mining, tf-idf, support vector machine

Abstract

The mood of a song affects listeners' perception and experience of music, but manual mood identification has become less efficient with the increasing availability of digital songs on streaming platforms. This study aims to automatically classify song moods based on lyric analysis using the Term Frequency–Inverse Document Frequency (TF-IDF) method and the Support Vector Machine (SVM) algorithm. The dataset used consists of a collection of song lyrics that have been processed through text preprocessing stages, including text cleaning, letter normalization, and removal of irrelevant common words. Lyric features are extracted using TF-IDF and used as input in the SVM model training process to predict the mood of unlabeled songs. The classification results show that moods with high emotional intensity, such as angry, excited, and happy, dominate the predictions, while romantic and sad moods are fewer in number. Model performance evaluation using accuracy, precision, recall, and F1-score metrics shows that SVM is capable of classifying song moods based on lyrics with stable and reliable performance. These findings indicate that the combination of TF-IDF and SVM is effective for automatic song mood identification and has the potential to be further developed in emotion-based music recommendation systems, thereby facilitating digital platforms in presenting music content that suits listeners' emotional preferences.

References

Alluri, V. (2019). Tollywood Emotions: Annotation of Valence-Arousal in Telugu Song Lyrics.

Bischoff, K., Firan, C. S., Paiu, R., Nejdl, W., De, L. S., Laurier, C., & Sordo, M. (2009). MUSIC MOOD AND THEME CLASSIFICATION - A HYBRID APPROACH. Ismir, 657–662.

Boutzi, A. M., Stamataros, L., & Figgou, L. (2024). Κατασκευές Της Αιτιογένεσής Και Της (Ανα) Παραγωγής Της Αστυνομικής Βίας Στο Πλαίσιο Συνεντεύξεων Με Νέους Ενηλίκους. Psychology: The Journal of the Hellenic Psychological Society, 29(1), 194–213. https://doi.org/10.12681/psy

Dixon, S., Pearce, M. T., & Halpern, A. R. (2016). Bucknell Digital Commons. 472–492.

Fell, M., Cabrio, E., Tikat, M., Michel, F., Buffa, M., & Gandon, F. (2023). The WASABI song corpus and knowledge graph for music lyrics analysis. Language Resources and Evaluation, 57(1), 89–119. https://doi.org/10.1007/s10579-022-09601-8

Khadatkar, D. R. (2022). A Hybrid Approach To Music Recommendation Using Sentiment Analysis. 1(1), 6–9.

Li, P. (n.d.). Machine Learning Techniques for Pattern Recognition in High-Dimensional Data Mining.

Martin, A., & Uriarte, S. (2023). Introducci ´ on. 23, 3561–3570. https://doi.org/10.59427/rcli/2023/v23cs.3561-3570

Mcdonald, B., Böckler, A., Kanske, P., Mcdonald, B., Böckler, A., & Kanske, P. (2022). This is a self-archiving document ( accepted version ): Soundtrack to the social world : Emotional music enhances empathy , compassion , and prosocial decisions but not theory of mind . Soundtrack to the Social World : Emotional Music Enhances Empathy , C. 22(1).

Mishev, K., Gjorgjevikj, A., Vodenska, I., Chitkushev, L. T., & Trajanov, D. (2020). Evaluation of Sentiment Analysis in Finance: From Lexicons to Transformers. IEEE Access, 8, 131662–131682. https://doi.org/10.1109/ACCESS.2020.3009626

Pakpahan, D., Siallagan, V., & Siregar, S. D. (2023). Classification of E-Commerce Product Descriptions with The TF-IDF and SVM Methods. 7(4), 2130–2137.

Pyrovolakis, K., Tzouveli, P., & Stamou, G. (2022). Multi-Modal Song Mood Detection with Deep Learning †.

Romero, R., Iglesias, E. L., & Borrajo, L. (2015). Research Article A Linear-RBF Multikernel SVM to Classify Big Text Corpora. 2015.

Science, D., Betti, L., Abrate, C., & Kaltenbrunner, A. (2023). Large scale analysis of gender bias and sexism in song lyrics. https://doi.org/10.1140/epjds/s13688-023-00384-8

Way, S. F., Garcia-Gathright, J., & Cramer, H. (2020). Local trends in global music streaming. Proceedings of the 14th International AAAI Conference on Web and Social Media, ICWSM 2020, Icwsm, 705–714. https://doi.org/10.1609/icwsm.v14i1.7336

Zaanen, M. Van, & Kanters, P. (2010). AUTOMATIC MOOD CLASSIFICATION USING TF * IDF BASED ON LYRICS. Ismir, 75–80.

Zhelezniak, V., Savkov, A., & Hammerla, N. (2020). Estimating mutual information between dense word embeddings. Proceedings of the Annual Meeting of the Association for Computational Linguistics, 8361–8371. https://doi.org/10.18653/v1/2020.acl-main.741

Zhou, D., Wu, S., Wang, Q., Xie, J., Tu, Z., & Li, M. (2020). Emotion Classification by Jointly Learning to Lexiconize and Classify. COLING 2020 - 28th International Conference on Computational Linguistics, Proceedings of the Conference, 3235–3245. https://doi.org/10.18653/v1/2020.coling-main.288

Downloads

Published

2025-06-01