{'fraction_non_alphanumeric': 0.030351833498513378, 'fraction_numerical': 0.008857779980178395, 'mean_word_length': 5.113214691404771, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sentiment Analysis of Social Media Content for Music Recommendation

There is a growing use of social media for communication and entertainment. The information obtained from these social media platforms like Facebook, Linkedln, Twitter and so on can be used for inferring users’ emotional state. Users express their emotions on social media such as Twitter through text and emojis. Such expression can be harvested for the development of a recommender system. In this work, live tweets of users were harvested for the development of an emotion-based music recommender system. The emotions captured in this work include happy, fear, angry disgusted and sad. Users tweets in the form of emojis or text were matched with predefined variables to predict the emotion of users. Random testing of live tweets using the system was conducted and the result showed high predictability.


Introduction
The internet and social media users are increasing. Social Media is a kind of communication on the internet which allows users to post and share their actions with a group of individuals in their network. Social media plays a crucial role in everyday life and business, particularly in terms of product promotion and internet marketing. We can't dispute that social media has grown ingrained in our lives. The internet usage factor is constantly increasing as the price of electronic devices and gadgets, particularly smartphones, continues to fall. A device can be owned by almost anyone, including children and adults. The highly popular activities of internet users are social networking via Facebook, WhatsApp, Twitter, YouTube, Instagram, and so on. Music, on the other hand, has piqued people's interest through radio, music players, television, and web music; more recently, Twitter and YouTube, the most popular media sharing platforms, have emerged as alternative music listening platforms. Twitter is a social networking platform that allows users to share videos online. Users can upload, watch, share, and comment on videos, which can be music, television shows, advertisements, or instructional films.
Because user comments may tell us many things, such as complacency, user emotions, or opinion, user comments are a useful information source for adding more value to online resources, such as music, video, books, and other multimedia resources, using collaborative intelligence. Several studies have been done to employ user comments for sentimental analysis, e.g. LIKE or UNLIKE, there are still few exploitations of such comments for detecting emotion (user mood) on online resources. However, with emotion recognition, we can understand the content of online resources and use the recognition result for further value-added services, such as product recommendations.
Recommendation and prediction systems use diverse data criteria ranging from personality, age, race, background, geographical location, history of activities, and psychological states to predict user's preference. Consumers of different products and recipients of services as well as media content such as music and movies, or other entertainment or activities, desire experiences that they find enjoyable and meet their tastes, moods, and preferences. With a multiversity of such content and activities available and limited time for viewing, listening, consuming, or experiencing, consumers must increasingly rely on recommendations from other users and recommendation systems. For instance, Netflix, Jumia, Amazon, Konga, Academia, Google, and so on have prediction engines that suggest music and movies as well as other content that a user may like based on user preference or records (Polignano, Basile, Rossiello, De Gemmis, & Semeraro, 2017).
Music is extremely vital in human life. Many methods have been used to communicate music throughout the community, including oral methods such as singing and technical methods such as cassette tape, CD, or DVD. However, it wasn't until 1991 that music was digitalized into a 0 and 1-bit sequence, and the transmission of music changed in a way that made music more popular than before. Audio in digital form can be listened to in a variety of ways, including downloading and listening on a computer, burning to a compact disc, and, most notably, playing on portable music players. The storage of those portable music devices is continuously increasing and now has reached the number of 160GB, allowing users to load thousands of songs into their libraries. However, besides the convenience, that characteristic on the other hand troubles the users as they may experience confusion while choosing songs. For that reason, the music prediction system becomes a very essential subject in the current context. Several studies in this field have been done, proposing content-based, context-based, collaborative, music-mood-based, and community-sharing music recommendation systems (Yousefian Jazi, Kaedi, & Fatemi, 2021). Developing a music recommender system that tracks user emotion automatically on social media and recommend relevant music to users is still a challenge. The user emotion should be considered crucial input regarding the actual habit of listeners to choose songs by considering the relevancy between their feelings and the feelings those songs bring to them. Particularly, such systems are very useful in the case when the users want to find songs that match their current emotions but can't reveal what their emotions are, or are unable to declare or input their emotions to the system.
Drawing inferences from the above, one may ask what if the user's preferences and desire change based on their moods and emotional states? Unfortunately, present music prediction systems have limited abilities to accommodate such changes in preference or desire, and users, therefore, receive less than optimal experiences. There is, therefore the need for an improved system that provides a room that uses user's emotional data to overcome the deficiency of conventional user prediction systems. This study, therefore, seeks to improve the existing systems by designing a music prediction system based on user emotions expressed on social media with an emphasis on Twitter. The remaining part of the paper is as follows: Section II is the literature. Section III is the methodology. The result of this work is presented in Section IV. A summary of the research and the future work is presented in the concluding section.

II Literature review
Social networks, such as Facebook, Google+, and Twitter are becoming very important methods of communication and social interaction between people. Social media is also a prominent economic domain (Sharma, Kaur, Sen, & Seth, 2020), with social networks becoming one of the most important advertising platforms (Sharma et al., 2020). The huge numbers of people using such services and the enormous volume of data readily available from such networks make them a very compelling research target for social scientists and data-mining experts. Such researchers have examined many issues using social network data, including characterizing user attributes (Chaudhary, Alam, Al-Rakhami, & Gumaei, 2021), the emotions and sentiments users express (Ju et al., 2021) and the language they use to express themselves (Sophia, Rajaraman, Mathan, & Ravi Shankar, 2021). Many recommender systems attempt to provide users with personalized recommendations on items such as movies, books, or music, based on a profile of the user (Sophia et al., 2021). One approach is collaborative filtering, where the system generates a recommendation based on items consumed by users similar to the target user in terms of the items, they have consumed in the past (Akuma & Iqbal, 2018;Polignano et al., 2017). The other approach is content filtering in which recommendation is made from user's previous and current activities (Polignano et al., 2017).
Several sentiment analysis works could be divided into two groups. The first group, sentiment analysis focuses on the classification of a text into neutral, positive, and negative sentiments (Polignano et al., 2017;Saari & Eerola, 2014). In research by Olubolu, Alhashmi, & Eu-Gene (2012), SentiWordNet and Yoruba sentiment lexicon were used to create a sentiment analysis algorithm for Yoruba movies, as well as a corpus of 15,000 Yoruba YouTube comments. They tagged comments manually with three labels: good, negative, and neutral. Bravo-Marquez, Mendoza, & Poblete (2013) presented an approach for sentiment classification on Twitter messages based on a combination of several existing lexical resources and sentiment analysis methods. Based on Twitter data, Nagarsekar, Mhapsekar, Kulkarni, and Kalbande (2013) divided emotion into six categories: joy, sadness, anger, disgust, fear, and surprise. Three datasets were utilized to evaluate two machine learning algorithms: Nave Bayes and support vector machine. A similar evaluation was conducted by Saari & Eerola (2014) in the study on music content and movie recommendation. Liu & Jiang (2019) build a model based on the K-Mean algorithm to predict whether a user will listen to a song. Their results show that the prediction is reliable.
Emotion-based prediction employs a content filtering strategy to acquire an individual's present or very recent emotional data, defining the emotion category, and then predicting what appears to be of interest to the user (Nagarsekar et al., 2013). In this work, the data about the user will be obtained from a given social network (Twitter feeds). Analysis of emotions has been applied to various forms of texts in Twitter and Facebook feeds including instant messaging and blogs in response to the explosion of social media services which have led to a growing application potential for personalization in human-computer systems such as personalized intelligent user interfaces, recommendation and prediction systems, and targeted marketing (Liu & Jiang, 2019). Researchers have been mining these massive volumes of personalized data produced in social media to obtain their demographics, language variation, likes and interests, emotions and opinions they express and so on (Akuma, Iqbal, Jayne, & Doctor, 2016; Grover, 2021; Medhat, Hassan, & Korashy, 2014).
Music can improve or worsen a listener's emotional condition. The researchers discovered that varying degrees of dissonance induced increased activity in the brain's paralimbic areas, which are linked to emotional processes (Yousefian Jazi et al., 2021). Surprisingly, activity was detected in the motivation, emotion, and arousal parts of the brain during a recent experiment assessing brain activity when people were played previously picked pieces of music that evoked intense sensations of pleasure for them (Yousefian Jazi et al., 2021). This proves that music has power. There are some unique approaches to determining which emotion model accounts for the feelings elicited and represented by music. One such promising source is the information offered by social media and online music providers. Social tags are used to describe a wide range of information in the music industry (genre, geography, emotion, opinion, instrumentation, etc.), out of which emotions account for approximately 5% of the most used tags (Polignano et al., 2017). Several research have used semantic computing to find emotion dimensions arising from semantic interactions between tags, and some evidence has been found to support the valence-arousal formulation (Krommyda, Rigos, Bouklas, & Amditis, 2021). Such observations have been formalized as Affective Circumplex Transformation (ACT) that provides an effective way of predicting the emotional content of music (Grover, 2021;Gupta, Mehra, & Vinay, 2015).
Emotions can be sensed through the face, body, and entire person, but prior research on abstract representations of emotions mainly looked at facial and bodily emotions (Medhat et al., 2014). It's still unclear if emotions can be abstractly represented despite the presence of all three sensory cues in specific brain regions. In this study, we used text and emojis representing emotions like anger, fear, happy, disgusted, and sad to predict music for users. In this research, we deployed a mechanism that recommends music based on emotions expressed by a user on Twitter. More so, as tweets have varying emotions expressed in form of emojis and text, we employed these emoji's/texts to recommend music to suit users' specific emotions.

III Methodology
In this study, we deploy an approach different from the previous approach and activities inherent in the development of the music recommender system. Whereas the previous approach used public data sets of Twitter sentiment messages, our approach involves live connection to Twitter API and extraction of users live tweets for analysis and recommendation. The method used in developing the process is shown in Fig. 1. Process involved in the development methodology are explained as thus: a. Twitter's API: This is the first step in the music recommender approach, this is where to gain access to user's tweets, hence, Twitter API provides an easy way to retrieve the tweets of an individual user through the username. b. User's Tweet: Haven gained access to the Twitter API and given a username, the information from a user's post known as a tweet is retrieved, tweets usually comprise text or emojis and some a combination of both.

c. Tweet Analysis:
Here, the analysis of the tweet is carried out, identifying the individual components that make up the tweets. We extract emojis and text identifying their expressions as it relates to emotions. Every emoji as well as certain keywords used on social media has an underlying connotation that expresses one's feelings, once analyzed and identified, we proceed to the next phase to discover emotions. d. Discover Emotions: After identifying the individual components that make up a tweet, we match these components with predefined variables, these variables are five (5) parameters describing human emotions or mood as rightly captured in Table 1. e. Recommend Music: When a user's emotion is discovered, we match these emotions with suitable songs that are recommended to the user. Figure 1: Diagram showing the process of the emotion-based music recommendation system Twitter messages are public hence Twitter API provides an easy way to retrieve the tweets of an individual user given a username, but users can also send private "direct message". The emotions are based on five categorical variables as shown the Table 1.

IV Results
As earlier stated in this study, we designed the system to be readily available to all and sundry hence no registration or login is required to gain access to the system, a user can visit the system with free access and use it. A visitor on the system is required to insert a Twitter user account in the text field provided on the index page, the user account is then recovered from twitters API and tweets from the account are retrieved. The retrieved content of the tweet capturing the emojis and texts was analysed automatically and the recommendation was made based on the emotion of the user as expressed in the tweet. Figure 2 to 5 shows the returned results of the users' emotion for happy mood, angry mood, sad mood, fear mode and disgusted mode based on the keywords containing any of the listed parameters in Table 1 above.     Random tweets were entered into the system to evaluate the prediction accuracy, and the results returned received subjective approval by the users.

Conclusion
This paper developed an emotion-based recommender system using users' tweets. The system uses predefined conditions to recommend music to users when they are happy, angry, afraid, sad and disgusted. The system linked tweeter API and random live tweets were harvested and used for unstructured evaluation of the system. A subjective affirmation of the efficacy of the system by users was observed. The ease of use of the system indicates that multiple users can use the system concurrently. Future work will involve the use of machine language and ensemble