Skip to main content

Transformer-Based Approach Towards Music Emotion Recognition from Lyrics

  • Conference paper
  • First Online:
Advances in Information Retrieval (ECIR 2021)

Abstract

The task of identifying emotions from a given music track has been an active pursuit in the Music Information Retrieval (MIR) community for years. Music emotion recognition has typically relied on acoustic features, social tags, and other metadata to identify and classify music emotions. The role of lyrics in music emotion recognition remains under-appreciated in spite of several studies reporting superior performance of music emotion classifiers based on features extracted from lyrics. In this study, we use the transformer-based approach model using XLNet as the base architecture which, till date, has not been used to identify emotional connotations of music based on lyrics. Our proposed approach outperforms existing methods for multiple datasets. We used a robust methodology to enhance web-crawlers’ accuracy for extracting lyrics. This study has important implications in improving applications involved in playlist generation of music based on emotions in addition to improving music recommendation systems.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Spotify hits 130 million subscribers amid COVID-19. https://www.bbc.com/news/technology-52478708

  2. Abdillah, J., Asror, I., Wibowo, Y.F.A., et al.: Emotion classification of song lyrics using bidirectional LSTM method with glove word representation weighting. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi) 4(4), 723–729 (2020)

    Article  Google Scholar 

  3. Agarwal, A., Xie, B., Vovsha, I., Rambow, O., Passonneau, R.J.: Sentiment analysis of Twitter data. In: Proceedings of the Workshop on Language in Social Media (LSM 2011), pp. 30–38 (2011)

    Google Scholar 

  4. Barry, J.: Sentiment analysis of online reviews using bag-of-words and LSTM approaches. In: AICS, pp. 272–274 (2017)

    Google Scholar 

  5. Çano, E., Morisio, M.: Moodylyrics: a sentiment annotated lyrics dataset. In: Proceedings of the 2017 International Conference on Intelligent Systems, Metaheuristics & Swarm Intelligence, pp. 118–124 (2017)

    Google Scholar 

  6. Çano, E., Morisio, M., et al.: Music mood dataset creation based on Last.fm tags. In: 2017 International Conference on Artificial Intelligence and Applications, Vienna, Austria (2017)

    Google Scholar 

  7. Cliche, M.: BB\(\_\)twtr at SemEval-2017 task 4: Twitter sentiment analysis with CNNs and LSTMs. arXiv preprint arXiv:1704.06125 (2017)

  8. Dai, Z., Yang, Z., Yang, Y., Carbonell, J., Le, Q.V., Salakhutdinov, R.: Transformer-xl: attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860 (2019)

  9. Delbouys, R., Hennequin, R., Piccoli, F., Royo-Letelier, J., Moussallam, M.: Music mood detection based on audio and lyrics with deep neural net. arXiv preprint arXiv:1809.07276 (2018)

  10. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)

  11. Eerola, T., Lartillot, O., Toiviainen, P.: Prediction of multidimensional emotional ratings in music from audio using multivariate regression models. In: ISMIR, pp. 621–626 (2009)

    Google Scholar 

  12. Eerola, T., Vuoskoski, J.K.: A comparison of the discrete and dimensional models of emotion in music. Psychol. Music 39(1), 18–49 (2011)

    Article  Google Scholar 

  13. Fell, M., Nechaev, Y., Cabrio, E., Gandon, F.: Lyrics segmentation: textual macrostructure detection using convolutions. In: Proceedings of the 27th International Conference on Computational Linguistics, pp. 2044–2054 (2018)

    Google Scholar 

  14. Greasley, A., Lamont, A.: Musical preferences. In: Oxford Handbook of Music Psychology, pp. 263–281 (2016)

    Google Scholar 

  15. Han, Q., Guo, J., Schuetze, H.: Codex: combining an SVM classifier and character n-gram language models for sentiment analysis on Twitter text. In: Second Joint Conference on Lexical and Computational Semantics (* SEM), Volume 2: Proceedings of the Seventh International Workshop on Semantic Evaluation (SemEval 2013), pp. 520–524 (2013)

    Google Scholar 

  16. Hu, X., Downie, J.S.: When lyrics outperform audio for music mood classification: a feature analysis. In: ISMIR, pp. 619–624 (2010)

    Google Scholar 

  17. Hu, Y., Chen, X., Yang, D.: Lyric-based song emotion detection with affective lexicon and fuzzy clustering method. In: ISMIR (2009)

    Google Scholar 

  18. Huang, Y.H., Lee, S.R., Ma, M.Y., Chen, Y.H., Yu, Y.W., Chen, Y.S.: EmotionX-IDEA: emotion BERT-an affectional model for conversation. arXiv preprint arXiv:1908.06264 (2019)

  19. Kansara, D., Sawant, V.: Comparison of traditional machine learning and deep learning approaches for sentiment analysis. In: Vasudevan, H., Michalas, A., Shekokar, N., Narvekar, M. (eds.) Advanced Computing Technologies and Applications. AIS, pp. 365–377. Springer, Singapore (2020). https://doi.org/10.1007/978-981-15-3242-9_35

    Chapter  Google Scholar 

  20. Kleedorfer, F., Knees, P., Pohle, T.: Oh oh oh whoah! towards automatic topic detection in song lyrics. In: ISMIR, pp. 287–292 (2008)

    Google Scholar 

  21. Knutson, A.L.: Japanese opinion surveys: the special need and the special difficulties. Public Opin. Q. 9(3), 313–319 (1945)

    Article  Google Scholar 

  22. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101 (2017)

  23. Malheiro, R., Panda, R., Gomes, P., Paiva, R.: Music emotion recognition from lyrics: a comparative study. In: 6th International Workshop on Machine Learning and Music (MML 2013). Held in \(\ldots \) (2013)

    Google Scholar 

  24. Malheiro, R., Panda, R., Gomes, P., Paiva, R.P.: Emotionally-relevant features for classification and regression of music lyrics. IEEE Trans. Affect. Comput. 9(2), 240–254 (2016)

    Article  Google Scholar 

  25. Mas-Herrero, E., Marco-Pallares, J., Lorenzo-Seva, U., Zatorre, R.J., Rodriguez-Fornells, A.: Individual differences in music reward experiences. Music Percept.Interdisc. J. 31(2), 118–138 (2012)

    Article  Google Scholar 

  26. Melchiorre, A.B., Schedl, M.: Personality correlates of music audio preferences for modelling music listeners. In: Proceedings of the 28th ACM Conference on User Modeling, Adaptation and Personalization, pp. 313–317 (2020)

    Google Scholar 

  27. Ohana, B., Tierney, B.: Sentiment classification of reviews using SentiWordNet. In: 9th IT&T Conference, vol. 13, pp. 18–30 (2009)

    Google Scholar 

  28. Opitz, J., Burst, S.: Macro F1 and macro F1. arXiv preprint arXiv:1911.03347 (2019)

  29. Panda, R., Malheiro, R., Rocha, B., Oliveira, A., Paiva, R.P.: Multi-modal music emotion recognition: a new dataset, methodology and comparative analysis. In: International Symposium on Computer Music Multidisciplinary Research (2013)

    Google Scholar 

  30. Pang, B., Lee, L.: A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. arXiv preprint cs/0409058 (2004)

    Google Scholar 

  31. Patel, A., Tiwari, A.K.: Sentiment analysis by using recurrent neural network. In: Proceedings of 2nd International Conference on Advanced Computing and Software Engineering (ICACSE) (2019)

    Google Scholar 

  32. Pennington, J., Socher, R., Manning, C.D.: Glove: global vectors for word representation. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1532–1543 (2014)

    Google Scholar 

  33. Peters, M.E., et al.: Deep contextualized word representations. arXiv preprint arXiv:1802.05365 (2018)

  34. Qiu, L., Chen, J., Ramsay, J., Lu, J.: Personality predicts words in favorite songs. J. Res. Pers. 78, 25–35 (2019)

    Article  Google Scholar 

  35. Raina, P.: Sentiment analysis in news articles using sentic computing. In: 2013 IEEE 13th International Conference on Data Mining Workshops, pp. 959–962. IEEE (2013)

    Google Scholar 

  36. Russell, J.A.: A circumplex model of affect. J. Pers. Soc. Psychol. 39(6), 1161 (1980)

    Article  Google Scholar 

  37. Sun, C., Qiu, X., Xu, Y., Huang, X.: How to fine-tune BERT for text classification? In: Sun, M., Huang, X., Ji, H., Liu, Z., Liu, Y. (eds.) CCL 2019. LNCS (LNAI), vol. 11856, pp. 194–206. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-32381-3_16

    Chapter  Google Scholar 

  38. Xia, Y., Wang, L., Wong, K.F.: Sentiment vector space model for lyric-based song sentiment classification. Int. J. Comput. Process. Lang. 21(04), 309–330 (2008)

    Article  Google Scholar 

  39. Yang, Y., Liu, X.: A re-examination of text categorization methods. In: Proceedings of the 22nd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 42–49 (1999)

    Google Scholar 

  40. Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R.R., Le, Q.V.: XLNet: generalized autoregressive pretraining for language understanding. In: Advances in Neural Information Processing Systems, pp. 5753–5763 (2019)

    Google Scholar 

  41. Zhang, Y., Yang, Q.: An overview of multi-task learning. Natl. Sci. Rev. 5(1), 30–43 (2018)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yudhik Agrawal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Agrawal, Y., Shanker, R.G.R., Alluri, V. (2021). Transformer-Based Approach Towards Music Emotion Recognition from Lyrics. In: Hiemstra, D., Moens, MF., Mothe, J., Perego, R., Potthast, M., Sebastiani, F. (eds) Advances in Information Retrieval. ECIR 2021. Lecture Notes in Computer Science(), vol 12657. Springer, Cham. https://doi.org/10.1007/978-3-030-72240-1_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-72240-1_12

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-72239-5

  • Online ISBN: 978-3-030-72240-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics