=Paper= {{Paper |id=Vol-3054/paper5 |storemode=property |title=Recognition of Eudaemonic and Hedonic Qualities from Song Lyrics |pdfUrl=https://ceur-ws.org/Vol-3054/paper5.pdf |volume=Vol-3054 |authors=Sead Hrustanović,Branko Kavšek,Marko Tkalčič |dblpUrl=https://dblp.org/rec/conf/hci-si/HrustanovicKT21 }} ==Recognition of Eudaemonic and Hedonic Qualities from Song Lyrics== https://ceur-ws.org/Vol-3054/paper5.pdf
Recognition of Eudaimonic and Hedonic Qualities
from Song Lyrics
Sead Hrustanović1 , Branko Kavšek1,2 and Marko Tkalčič1
1
  University of Primorska, Faculty of Mathematics, Natural Sciences and Information Technologies, Glagoljaška 8,
SI-6000 Koper, Slovenia
2
  Jožef Stefan Institute, Department for Artificial Intelligence, Jamova 39, SI-1000 Ljubljana, Slovenia


                                         Abstract
                                         This work addresses the research question of how to use machine learning methods in order to develop
                                         a computational model which is able to predict the hedonic and eudaemonic qualities of songs from
                                         song lyrics. We conducted a survey on 1991 users (1904F, 87M) with an average age of 28 years (SD
                                         = 9 years), where we gathered demographics, big five personality test, eudaemonic and hedonic song
                                         tendencies, overall music sophistication and data for song classification. After that we gathered song
                                         lyrics by web scraping. Song lyrics were normalized, tokenized, lemmatized and stemmed, and a TF-IDF
                                         scored was assigned to each word in a song. The collected data was transformed into meaningful data
                                         and fed to machine learning models. We used classification and regression machine learning models. The
                                         classification models that were used are kNN, logistic regression, random forest, bagging, SVC and ridge,
                                         while the regressor models that were used are random forest and XGBoost. We created two models, one
                                         hedonic and one eudaemonic. The best models were achieved with bagging classifiers for both machine
                                         learning models, while the random forest regressor gave the best results out of the regressors. Our
                                         preliminary results indicate that there exists a connection between hedonia and eudaemonia and song
                                         lyrics, and that we can classify songs into highly hedonic or highly eudaemonic, with the created models.
                                         This study also showed that there exists a difference between eudaemonic and hedonic tendencies
                                         between genders, as well as that there exists a strong connection between emotions and eudaemonia.

                                         Keywords
                                         eudaimonia, hedonia, song lyrics, machine learning




1. Introduction
Music surrounds us - whether we listen to it in private or hear it at a shopping mall, while
walking next to a coffee shop or even in an elevator - it is becoming almost an unavoidable
aspect of our lives. In a study by Roberts D.F. et al., it was shown that some young people
consider music as an element that defines their identity and their course through life [1]. The
respondents of this study even went as far as to compare music to oxygen and water. Elif
T.G. has shown in her research that the main reasons for listening to music are enjoyment,
emotional mood, peer group, and family [2]. The study has also shown that the majority of
the respondents listen to music between two to nine hours per day [2]. There have been many
studies conducted on emotion recognition based on different combinations of data features,

Human-Computer Interaction Slovenia 2021, November 11, 2021, Koper, Slovenia
Envelope-Open sead.hrustanovic.96@gmail.com (S. Hrustanović); branko.kavsek@famnit.upr.si (B. Kavšek);
marko.tkalcic@famnit.upr.si (M. Tkalčič)
                                       © 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
    CEUR
    Workshop
    Proceedings
                  http://ceur-ws.org
                  ISSN 1613-0073
                                       CEUR Workshop Proceedings (CEUR-WS.org)
such as the work done by Dan Yang [3], as well as some other works which were solely based on
music lyrics [4]. Eudaemonia is based on a self-determination motivational concept of pursuing
intrinsic values such as personal growth, relationships and health rather than extrinsic values
such as wealth, popularity and power [5]. Hedonia and eudaemonia are juxtaposed as opposing
perspectives on human wellness, with hedonia involving the seeking of happiness and life
satisfaction, and reducing negative affect [6].
   Music is often classified by the emotion it conveys, but what happens if we dig deeper and look
further than just at the specific emotion a certain song gives. We have seen that eudaemonia
and hedonia have shown to be useful for user modeling and recommendations, as shown by
Tkalcic et al. [7]. In their study the results show that eudaimonic user profiling effectively
divides users into pleasure-seekers and meaning-seekers. Therefore we can explore this idea
further by looking for hedonic and eudaemonic qualities within songs by using song lyrics
instead of movies. Eudaemonia equates happiness with the human ability to pursue personal
and societal meaningful values, while hedonia equates happiness with pleasure, enjoyment and
comfort [8].
   Searching for hedonic and eudaemonic qualities within songs by human annotation would
be time consuming. This is why a method for the automatic recognition should be devised.
A model which will be able to take in the song lyrics and as an output give us a hedonic and
eudaemonic quality of the given song. The main purpose of this study is to devise a model for
the automatic recognition of the hedonic and eudaemonic qualities of songs from their lyrics.
Therefore, the goal is to create a model which will be able to differentiate between eudaemonia
and hedonia in song lyrics and as a result show us how eudaemonic or hedonic a certain song
is. Here we present the preliminary results of our work up to now.


2. Related Work
2.1. Hedonism
There are many definitions of hedonism, such as: ”Pursuit of or devotion to pleasure, especially
to the pleasures of the senses.”, or ”Pursuit of or devotion to pleasure, especially to the pleasures
of the senses.”, or ”The definition of hedonism is the relentless pursuit of pleasure”. We can see
that most of these definitions resolve around pleasure, and this is because the word Hedonism
comes from the Attic-Greek word hedone, meaning simply “pleasure” [6]. Hedonism is a
theory which states that pleasure and pain are the only factors in a human life [9]. There are
many different kinds of hedonism, such as prudential hedonism [10], but mostly hedonism is
represented as a pursuit to pleasure. Just like the other hedonistic values which resolve around
the pursuit of pleasure and avoidance of pain, prudential hedonism also resolves around the
idea that the only pleasure is good for us in itself and only pain is bad for us in itself [11].
   Hedonism is the pursuit of pleasure and a sensual self-indulgence. In philosophy it is an
ethical theory that states that pleasure is the highest good and proper aim of human life. There
are many hedonic theories but most of them revolve around pleasure playing the main role in
one’s life.
2.2. Eudaimonia
Eudaemonia is a Greek word which is most commonly translated as ’happiness’. Eudaemonia
appears in aristotelianism and is described as a life of activity governed by reason. Eudaemonia
is all about states and pursuits which are associated with developing the best in yourself.
Eudaemonia is also a term which is used in religion, and it is mostly referred to as conception
of what it means to be a better person.
   Eudaemonia revolves around human flourishing or living well. It is an orientation towards a
better good [6].
   Hedonia and eudaemonia relate to different experiences, as described above. People that
pursue both eudaemonia and hedonia, have a better picture of well-being compared to people
that pursue one or another. Hedonia is related to carefreeness, positive affects and very low
negative affects, while eudaemonia is related to meaning and elevation. Most people have
both, eudaemonic and hedonic needs, but for the purpose of this study, we will be doing
an oversimplification regarding separating people with hedonic tendencies and people with
eudaemonic tendencies [6]. People that tend to have better eudaemonic tendencies, tend to seek
for a deeper meaning in most of the things in their lives, while people with hedonic tendencies
tend to seek pleasure and fun in life – without a deeper meaning included.
Based on the definitions of hedonism and eudaemonia we are going to propose a definition of
eudaemonia and hedonism in song lyrics.
Songs that have a deeper meaning, or that make someone question everything on a deeper level
are going to be categorized as eudaemonic songs.
Songs that don’t have a deeper meaning, but are rather based on different pleasures, enjoying
life, and not digging deep for a different meaning are going to be categorized as hedonic songs.
   A current problem, that this work will be dealing with, is the lack of methods for automatic
recognition of hedonic and eudaemonic qualities in songs. There have been many studies that
dealt with music recognition from song lyrics before, as shown by Malheiro et al. [4], but none
of them went as far as to explore the hedonic and eudaemonic qualities of song lyrics.
   Recognition of music emotion has been going around for two decades. Music emotion can be
extracted from songs in many ways, such as from song lyrics, speech audio signals [12] etc. In
his phd thesis, Renato P. writes about emotion-based analysis and classification of audio music
using audio signals, which explores the typical approaches of emotion recognition [13]. Most
of the emotion recognition approaches start with a data set, usually composed of songs and
emotion ratings collected from listeners. From here on, the data is processed by computational
algorithms which extract and summarize the data characteristics. In her paper, Shamila N. writes
about widely used feature selection and feature extraction techniques and their effectiveness
when it comes to the performance of learning algorithms [14].
   As mentioned, all of the work is focused on deriving emotion characteristics from songs
through different channels. But what if we could try to derive and classify songs not only
based on emotions, but on other factors as well. People have different pathways to happiness,
and these pathways can be described as hedonia and eudaemonia, which are both important
aspects of wellbeing [15]. Eudaemonia and hedonia have been shown to be useful for user
modeling and recommendations. Tkalcic et al. have shown that there exists an eudaemonic
user profiling which divides users into pleasure-seekers and meaning-seekers [7]. In their study,
they performed a characterization of users in terms of eudaimonic and hedonic preferences.
Although, this profiling was used in movies, we believe it can also be transfered to songs.


3. Methodology
In order to devise a model which will be able to differentiate between eudaemonia and hedonism
in song lyrics and tell us how eudaemonic or hedonic a certain song is, we need to collect song
lyrics and the weighted eudaemonic/hedonic scores for each song. We are going to acquire
the song lyrics by web scraping, and the weighted eudaemonic/hedonic scores by a survey,
where respondents will answer questions about songs, and these questions will be transformed
into hedonic and eudaemonic scores. In order to explore the topic further, we are going to be
collecting some additional data as well.
   For the purpose of this study, which is to create a model that will be able to do automatic
recognition of hedonic and eudemonic qualities in songs, we need to choose songs that are going
to give us meaningful information. To avoid bias and in fact collect songs that are going to be
meaningful for this study, we ran a pre study with 17 respondents. Our sample consisted of 17
students, 16F and 1M, with an average age of 25 years (SD=4 years). The respondents were given
definitions of eudaemonia and hedonism and were asked to give their favorite songs for each
category. At the end of this pre study, we collected 100 songs for each category, respectively.
   After the songs were collected, a second pre study test took place, where the collected songs
from the first pre study were put in a list and the same respondents were asked to vote for the
songs which they deem to fit the given category. For eudaemonia, they were given a list of
100 songs that were collected in the first pre study, and they were asked to choose the ones
they think fit the eudaemonic category. The same process was done for the hedonic category
of songs. After we collected responses from the respondents, we were left with a list of songs
and a certain weight assigned to them. This weight is represented by a score, derived from
respondents’ votes. Since respondents were able to choose or not to choose a song for each of
the two categories, the final score represents a percentage of how many respondents picked
the song over the overall number of respondents included in the pre study. The songs that
were deemed to fit the given category by the most respondents were the songs that were later
included in the main study.
   In order to create a machine learning model which will be able to recognize hedonic and
eudaemonic qualities of songs from song lyrics, we need to obtain the song lyrics as well. The
song lyrics were obtained using python and beautiful soup, regular expressions, and requests
packages. We created our own model for obtaining song lyrics from the web. This model
consists of a function which scrapes a website, taking the lyrics of a given song and saves the
lyrics of that song to a dictionary.
   The main study consisted of collecting data with a 7-part survey. The survey was collected
using an 1ka platform, while the respondents were reached via social media platforms. Each
part of the survey collected meaningful data which was used for further data analysis. The
first five parts of the survey are used in order to model a relationship between respondents’
personality traits, music sophistication and their eudaemonic and hedonic qualities, while the
last two parts of the survey are used for modeling a machine learning algorithm.
  We collected the following groups of data through the questionnaire:

    • demographics
    • music genre preferences
    • Big-five personality
    • Eudaimonic and Hedonic Music orientation
    • Music Sophistication Index
    • Song preferences
    • Eudaimonic and Hedonic perceptions of songs

   We cleaned the song lyrics by performing stopwords removal, tokenization, stemming and
lemmatization and extracted TF-IDF features. For predicting eudaimonia and hedonia charac-
teristics we evaluated several classifiers and regressors.


4. Results
4.1. Correlational Analysis
We first performed a correlational analysis among the groups of variables collected. Fig 1 shows
the results.




Figure 1: Correlational Analysis Results
4.2. Prediction
We performed two kinds of prediction: regression and classification. In classification we
performed median splitting. The target variables to predict were eudaimonic and hedonic
characteristics of songs. For regression, the baseline was the average value of the target variable
in the train set while for classification it was the most popular class in the train set.
   We are using a nested cross validation, with an outer loop splitting the data set into 5 folds,
repeating it 4 times. The nested 5-fold cross validation works in a way that it splits the data set
into 5 folds, and each time one fold is the test set, while the remainder of the data is the train set.
Data are randomly split into 5 folds, and in each iteration we have a test set and a validation
set. The model works in a way that it trains each proposed parameter set on the train data,
evaluates it on the validation data and keeps track of the accuracy for classification models,
and RMSE, MSE and MAE for regression. After looking at the average score for each set of the
parameters, it chooses the best ones and trains a model based on that set of parameters.
   We are also applying PCA on our data set. We are using a 70% for the number of components
parameter.
   The prediction results are reported in Tabs. 4.2 through 4.2.

                                  MODEL            ACCURACY        STD
                               Random Forest         0.515         0.099
                                    KNN              0.523         0.052
                                     SVC             0.515         0.062
                             Logistic Regression     0.531         0.057
                                    Ridge            0.531         0.045
                                  Bagging            0.538         0.054
                                  Baseline           0.423         0.069
Table 1
Eudaemonic machine learning model accuracy and standard deviation results for classifiers and the
baseline




5. Discussion and Conclusion
The results presented here are still preliminary as we just started this line of research.
   Comparing the results from our models and the baseline model results we can see that best
classifiers from our eudaemonic and hedonic models perform better than the baseline. The best
accuracy from the eudaemonic model is 0.54, with a standard deviation of 0.054, compared to
the baseline model of 0.42, with a standard deviation of 0.069. This accuracy score comes from
a Bagging classifier.
   When it comes to the regressors, neither the hedonic nor eudaemonic regression model gives
us satisfying results compared to the baseline model. The RMSE of the eudaemonic model is
equal to 0.132, compared to the baseline of 0.132 we see no improvement in the performance.
On another note, we see that the hedonic model performs slightly better than the baseline
model with the RMSE score of 0.076 compared to the baseline model of 0.078.
                                  MODEL             ACCURACY       STD
                               Random Forest          0.485        0.093
                                    KNN               0.523        0.099
                                     SVC              0.500        0.047
                             Logistic Regression      0.423        0.081
                                    Ridge             0.485        0.105
                                  Bagging             0.546        0.057
                                  Baseline            0.408        0.031
Table 2
Hedonic machine learning model accuracy and standard deviation results for classifiers and the baseline

                            SCORE     SCORE STD       BASELINE     BASELINE STD
                  MAE        0.115      0.011           0.115          0.010
                   MSE       0.018      0.003           0.018          0.002
                  RMSE       0.132      0.012           0.132          0.010
Table 3
Eudaemonic machine learning model MAE, MSE and RMSE results for regressors and the baseline

                            SCORE     SCORE STD       BASELINE     BASELINE STD
                  MAE        0.064      0.010           0.064          0.007
                   MSE       0.006      0.002           0.006          0.002
                  RMSE       0.076      0.012           0.078          0.008
Table 4
Hedonic machine learning model MAE, MSE and RMSE results for regressors and the baseline



   Some of the limitations that this study has come across are the number of female respondents
and the number of male respondents. The difference is drastically huge with having 1904 female
respondents and 87 male respondents. Since we have seen that there exists a difference between
eudaemonic and hedonic tendencies between genders, this raises the question whether the
eudaemonic and hedonic scores of songs would have changed if we had more of a balanced
gender test group. Another limitation could possible be the way the study was conducted. This
specific study was conducted by a survey on an online source, therefore the respondents were
only able to see a certain part of lyrics (mainly the introduction and the chorus). It would be
interesting to conduct this study in person where we can make sure that the respondent has
understood the song lyrics more, therefore we might change the outcome results of hedonic
and eudaemonic scores for each song. Another consideration for the future work is to add more
songs in the study. While building models we came accross an issue of splitting the data into
testing, validating and training sets with K-fold cross validation because of the small amount of
songs included in the study.
   Songs can be classified into hedonic and eudaemonic by human annotiation, but now we
see that it can also be done by machine learning models. In this work we addressed a research
question of how to use machine learning methods in order to develop a computational model
which will be able to predict the hedonic and eudaemonic qualities of songs from song lyrics.
After collecting survey results from 1991 users (1904F, 87M) with an average age of 28 years (SD
= 9 years), where we gathered demographics, big five personality test, eudaemonic and hedonic
song tendencies, overall music sophistication and data for song classification, we successfully
created a model which classifies songs into highly eudaemonic and highly hedonic, based on
the features we extracted from song lyrics. Out of the two classification models, the hedonic
model does not perform as well as the eudaemonic one, even though both models perform better
than the baseline. On the other hand, the regression model created was not able to perform
better than the baseline. The created classification models are able to classify songs with a
higher accuracy than a baseline model, which opens new possibilities of modeling song user
recommendation based on hedonia and eudaemonia with the application of given limitations to
this study.


References
 [1] D. F. Roberts, U. G. Foehr, V. Rideout, Generation m: Media in the lives of 8–18 year-olds,
     2005.
 [2] E. Tekin Gurgen, Social and Emotional Function of Musical Listening: Reasons for Listening
     to Music, Eurasian Journal of Educational Research 16 (2016) 1–30. doi:1 0 . 1 4 6 8 9 / e j e r .
     2016.66.13.
 [3] D. Yang, W. S. Lee, Music emotion identification from lyrics, ISM 2009 - 11th IEEE
     International Symposium on Multimedia (2009) 624–629. doi:1 0 . 1 1 0 9 / I S M . 2 0 0 9 . 1 2 3 .
 [4] R. Malheiro, R. Panda, P. Gomes, R. P. Paiva, Music Emotion Recognition from Lyrics: A
     Comparative Study, 6th International Workshop on Music and Machine Learning – MML
     2013 – in conjunction with the European Conference on Machine Learning and Principles
     and Practice of Knowledge Discovery in Databases – ECML/PKDD 2013 (2013) 1–5.
 [5] R. M. Ryan, V. Huta, E. L. Deci, Living well: A self-determination theory perspective on eu-
     daimonia, Journal of Happiness Studies 9 (2008) 139–170. doi:1 0 . 1 0 0 7 / s 1 0 9 0 2 - 0 0 6 - 9 0 2 3 - 4 .
 [6] V. Huta, The complementary roles of eudaimonia and hedonia and how they can be
     pursued in practice, Positive Psychology in Practice: Promoting Human Flourishing in
     Work, Health, Education, and Everyday Life: Second Edition (2015) 159–182. doi:1 0 . 1 0 0 2 /
     9781118996874.ch10.
 [7] M. Tkalčič, B. Ferwerda, Eudaimonic modeling of moviegoers, UMAP 2018 - Proceedings
     of the 26th Conference on User Modeling, Adaptation and Personalization (2018) 163–167.
     doi:1 0 . 1 1 4 5 / 3 2 0 9 2 1 9 . 3 2 0 9 2 4 9 .
 [8] A. Delle Fave, F. Massimini, M. Bassi, Hedonism and Eudaimonism in Positive Psychology,
     Springer Netherlands, Dordrecht, 2011. URL: https://doi.org/10.1007/978-90-481-9876-4_1.
     doi:1 0 . 1 0 0 7 / 9 7 8 - 9 0 - 4 8 1 - 9 8 7 6 - 4 _ 1 .
 [9] J. Ævarsson, Hedonism: Arguments for and against and the role of pain, Masters thesis,
     University of Iceland, 2015. URL: http://hdl.handle.net/1946/20938.
[10] D. M. Weijers, Hedonism and Happiness in Theory and Practice, Ph.D. thesis, 2012.
[11] D. L. Fay, A Defense of Basic Prudential Hedonism, Ph.D. thesis, 2020.
[12] Mustaqeem, S. Kwon, A CNN-assisted enhanced audio signal processing for speech
     emotion recognition, Sensors (Switzerland) 20 (2020). doi:1 0 . 3 3 9 0 / s 2 0 0 1 0 1 8 3 .
[13] R. Panda, Emotion-based Analysis and Classification of Audio Music, Ph.D. thesis, 2019.
     URL: http://hdl.handle.net/10316/87618.
[14] S. Nasreen, A survey of feature selection and feature extraction techniques in machine
     learning,sai,2014, 2014.
[15] L. Henderson, T. Knight, Integrating the hedonic and eudaimonic perspectives to more
     comprehensively understand wellbeing and pathways to wellbeing, International Journal
     of Wellbeing 2 (2012) 196–221. doi:1 0 . 5 5 0 2 / i j w . v 2 i 3 . 3 .