Music Recommendation System based on Emotions in User’s Social Media behaviour

—The modern lifestyle makes people more competitive. It can lead to more stressful situations in our lifestyle. With the changes in human emotional behaviour, they tend to share their feelings on social media platforms rather than communicating with relatives. Studies proved that people used to listen to music to avoid emotional situations in their life. But there is no proper way to get the most accurate music to listen to and avoid emotional conﬂicts. Resolving these conﬂicts, the music recommendation system based on emotion introduced. It analyses the users’ recent social media content and detects the various kind of emotions. The research was considered on a language-independent platform for both English and Sinhala. A labelled emotional dataset was chosen to evaluate the model. Using the English emotional detection model it was achieved a higher accuracy level than the Sinhala module.Furthermore, research revealed that there is no proper way to identify the exact emotion categories in lyrics due to different lines can give a different set of sentiment value. Therefore, the lyrics were categorised into positives and neutral to combined with the user’s emotions.


Introduction
This Introduction section define the domain "Music recommendation system based on emotion in users social media behaviour" with some background information , identified problem in the domain and the use of addressing the problem.

Background
Social media networks in the 21st century, are playing a vital role in almost every person's lifestyle. Since the development of technology, social media trends can be seen in people's lives. When something is happening around, posting, and sharing about that incident has become a very common practice within people. [1] Early days, people had television, radio and newspapers for entertainment, and they had time to relax. Also, people had good interpersonal relationships with society. But due to the competition of modern society, people have lost their interest to entertain themselves. Because of that reason, social media networks have become the most widely used communication method in human life. Using social networks people tend to make strong relationships with virtual friends, even some people find their soul mates through social networks. Complex life schedules force people to be stressed and make their lives complicated. They used social media networks to relieve the pressure they face and share their feelings. The influence of social media networks become a major technical aspect to control the human lifestyle. [2] Music is a universal language that can help people to relax their souls in a complicated life schedule. [3]Quality music can heal someone's pain and keep them happy throughout the day with a happy mood. The taste of music can be different from person to person. Even Though music can be used as a treatment for issues like dementia. [4] With the development of technology, the current lifestyle has turned out to be more complex and busier. Children must pay attention to their studies until the end of their educational career. After that, they have to engage in higher studies which brings much tension to their mind while the employers have to work with a stressful schedule in their workplaces. Human beings can be suffering from serious traumatic situations due to this busy life schedule. Though mental pressure cannot be considered as a serious illness it can be the root problems such as Depression. In this kind of situation, Music will be the best medicine [5] Music and emotions have a very close relationship since music can completely change the feelings and emotions of a person. [6] [7] Emotions can be a very sensitive aspect of different personalities. So, when suggesting a song, it should be very carefully selected.

Problem and Motivation
With modern complex lifestyle, people always try to be relaxed. Listening to music is one of the popular methods to relieve stress and have a fresh start. They must search for quality music to listen to and heal themselves. Music recommendation systems have been helped in various stages of people and suggest them a various range of music. Some can be relevant for their current mood but it will not suggest the exact emotions from songs. [8] There should be a proper way to extract the user's emotions and the emotion which is generated from the song. This combination will help to solve the problem which the author identified. Even though there is past research regarding music recommendation systems, People are not aware of those existing systems. Besides, the emotion analyzing domain is lacking with proper algorithms to identify the emotions of people, especially the sentiments with the Sinhala language. Hence, a proper system to analyze the emotions from social media platforms and an accurate system for song recommendations from the playlist according to the users feeling for their satisfaction is difficult to find. As the goal of the research, the author's motivation is to build up a system for any person to listen to a suitable song according to their current emotion.

Literature Review
Music recommendation systems based on emotion recognition are a prevalent research topic. Recent research has been done to identify the main components which should be implemented in the future The development of technology makes people's life cycle becomes more complicated. They had to face many challenges from the physical aspects as well as emotional breakdowns. Stress is the major issue people had to overcome with this competitive lifestyle, and it can lead to more dangerous situations like depression. (Acheampong, Wenyu, and Nunoo-Mensah, 2020). With the current education system and social behaviour, most students suffer from depression, which could be the worst problem soon [10]. Also, many professions related jobs become much more stressful and can lead to depression situations. But identifying such situations is very difficult (Nisar, Rasheed, and Qiang, 2018). People used many methods to overcome their stressful situations and keep mental health positive, and they express their stressful emotions using many forms such as social media. [12] Social media networks are the leading platform to share people's opinions. It isn't easy to maintain someone's thoughts and actions in social networks since it is very personal and interconnected. According to (Bruning, Alge, and Lin, 2020), increased use of such social network platforms influences society to share their thoughts. People share their daily activities, opinions, and feelings using social network platforms, and they expect to be relaxed using social networks. As per the research done by [13], they have identified the use of understanding the emotions shared in social media networks. The posts and comments consist of people's opinions, so they have specified that the mood and behaviour pattern can analyze users' thoughts. The research of Facebook Social Media for Depression Detection in the Thai Community [14] has discussed the importance of validating the users' engagement with Facebook and how they have used Facebook to share their thoughts. They have also suggested that social media can detect people's stress at a specific time. This research will use the above-mentioned social behaviours to identify the current mental state. And study will further be expanded to recognize the emotion using their post to suggest the most suitable music for their wellbeing.
Nimeshika and Ahangama have developed a system to identify the emotions using frequently used social media networks. They try to analyze the daily mood changes using the content posted in the user's social media profiles. They have considered different attributes, such as gender and psychological measures. They have allocated the points to the sentiments extracted from the posts and images shared by the user, analyzing Facebook posts. They have combined the score and temporarily weighted them according to the emotion. For their research, they have used supervised learning methods to analyze emotions. The previous study done by Gaind and Bharat has used a different approach than this. But Nimeshika and Ahangama have added more features to analyze the emotion of the user in their research. The emotion of the song is based on several key aspects. Lyrical meaning, music, beat, and rhythm of the song can significantly impact the feeling generated after listening to it. Past research has been conducted to identify the emotion from a song and recommend a suitable song matching with the user's current mood. [15] Chen and Tang research the Chinese song recommendation system based on its lyrical emotions. They have worked to develop a content-based recommendation platform for music. Their approach adopted several sentiment lexicon algorithms into the Chinese language, and for the sentiment analysis, they used corpusbased and lexicon-based textual sentiment methods. They have limited the use of the corpus-based analyzing process to ensure to reduce the computational overhead. Also, that method needs a broad set of training data sets to get the predicted accuracy. Using lexicon ontology and TF*IDF analysis, they have generated a new music emotion matrix. The lyric's classifications have mapped the importance of word combination with a specific mood against all moods. And they have created an emotion point matrix and calculate the emotion points. Considering the emotion points and the collaborative filtering model, they have calculated the similarity to predict the song for most related emotion. The experimental results found out that the collaborative filtering method is very accurate in recommending the music. But the limitation was they only predict songs considering four emotions, and they need to focus on the song features such as speed, tone to calculate the content value. EMOSIC [16] EMOSIC is an emotion-based music recommendation platform developed to suggest an accurate music playlist to the user according to their current mood. In EMOSIC, they have used face recognition technology to identify the users' moods. They have used users' realtime pictures and analyzed using image processing techniques to determine facial expressions. But people can fake their emotional expression in many ways. So, identify the emotion using facial expression is not an accurate method. Authors used Audio Emotion Recognition (AER) and Music Information Retrieval (MIR) methods to analyze a song's emotion. They have considered the song's tempo and the music to extract the feeling of the song. Compared to other past works, EMOSIC lacks accurate prediction results since they used only a few characteristics to analyze the song's emotion. As mentioned above, facial recognition is not the best method to identify users' current mood. Even the authors suggest considering the lyrics to analyze the emotion for their future studies.
The study is based on the song recommendation platform to a personalized emotional state. The authors extract the sentiments from social media and record the users' behavioural patterns to analyze the current mood. They have compared the three methods of emotion classifying techniques. Corpus-based, lexicon-based, and the hybrid method were their selected classifiers. They have attempted to design and develop a language-independent music recommendation system. So, extracting emotion from the text should be language independent. Lexicon-based classifiers are based on the dictionary word values, and they need to apply several algorithms to classify the sentiments in other languages. But machine learning-based approaches such as Corpus-based classifiers following supervised learning methods. The authors decided to choose the corpus-based classification and improved the accuracy; they have suggested using correction factors. They have used a language-independent sentiment classifier. But it should be focused on enhancing it further. The main weakness was music recommendation is based on a manual method. Such as after getting the current mood, users need to select songs on their own. Even though this product could detect the current mood from language independently, the recommendation is not up to the expected level.

Methodology
To analyzing the emotions in social media content and songs, author used natural language processing techniques. Initially to identify the emotions from English text contents, author used neural networks with labeled dataset. The English model will train after that. Also same model have used to identify the emotion content but the data set is different in both occasions.

DataSet Preparing
Data is the most important aspects when it comes to the implementation process. The author needs to select the most accurate and reliable data to achieve the expected outcome from the prototype. When implementing the system, the author had to find several data requirements.
• Text analysing data set for both supervised and unsupervised aspectsthe author chose the Kaggle website after do some web scraping to get the relevant data. Kaggle website consists of a variety of datasets for many domains. So author considers the Kaggle as a dataset provider for the first requirement. And as planned the data set was available with the Kaggle which annotated with emotion labels. • Sinhala labelled data set for emotion detection-For this author decided to follow the past research done in the Sinhala emotion detection domain and was able to get the dataset from the ACTSEA [18]. There was further annotation to complete before using it in the model. • Music lyrics analysing dataset to identify the music emotionslyrical dataset was extracted from the Kaggle website as well. The lyrical dataset consists of the lyrics of old songs with the name and their sentiment. The author had to manually scrape the relevant tags before feeding them to the model.

Pre-Processing data
Labeled dataset will pre-processed using tokenizing techniques. When tokenizing, it chops the sentences in to parts and remove the certain characters and punctuation

Embedding the Word vectors
In here author divided the six emotion classes joy,sadness,fear,love,surprise and anger in to six number classes and encoded with 0-5 values. It assigned to embedding matrix. In the embedding matrix, it used 1million word vector to improve the training accuracy. After the training of both modules, following classification matrices have been used to validate the performance of the models.

Performance
3.4.1. Accuracy. Accuracy defines the correctness of the model and it is a non-functional requirement for this implemented prototype. The author expecting an accuracy of more than 70precent for the emotion detection models. Accuracy is calculating the confusion matrix results. It can be defined as correct predictions divided by the total number of predictions for the relevant class.

Accuracy =( TP + TN ) / (TP+ TN+ FP + FN)
According to the results obtained for English and Sinhala text analyzing models, the following results were achieved for both models. To get these accuracy levels, the author trained the models for 30 epochs. Lyrics analyzing model achieved an accuracy of 72precent for its training.

Precision. Precision Describes whether the identified
True positive values are correct or not. To calculate the precision from the confusion matrix, the following equation has been used.

Precision = (TP) / TP + FP
According to the results "Sadness" has much higher precision since the model has seen the label for sadness more frequently. The same kind of diversion can be seen in the Sinhala model.

Recall = TP / TP + FN
According to the results obtained from the English text model, the highest recall value is in the sadness and joy classes 3.4.4. F1 Score. F1 Score can be used as a balanced matrix between precision and recall. Depending on the application researcher can be decided about the priority level that should be given to either precision or recall. In this research, priority was given equally since it is important to combine both results and an F1 score can be helpful to combine both matrices into one matrix. The following equation is used to calculate the F1 score.

Evaluation
The concept was chosen after evaluating the recent works in the music domains also need for an emotional recommendation system was self-experienced by the author. Even though there were existing recommendation systems, the author proposed a more unique concept to overcome the problem faced in his experience. As in the initial phase of the research, the author defined broader scope relevant to the master's level in the particular domain. But considering the requirements and the existing work, the scope was narrowed down to an implemented solution. Also, time constraint was a limitation to implement the scope defined initially. As for the limitations of the system, the accuracy of the lyrics analysing model identified. Since the lyrics data consist of old songs, the author had identified the limitation of enhancing the solution to recommend new songs. For future enhancement author listed the out of scope features and the functional requirements which are not implemented in the system. In the music recommendations, the author has discovered that the songs emotion detection accuracy can be improved if he considers the music features as well.

Conclusion
Music recommendation system based on Emotions in users' social media behaviour research project implemented by the author is a new approach to identify the emotions in users social media content and recommend songs related to songs emotions which were identified from the lyrics analysing. This research was developed targeting people who struggle to find the most suitable songs for their emotional status to relieve their pain and stress. It can minimize the gap between people and music by adding a matching aspect. By conducting this research, a new path has been open to all the developers to use social media and its content more productively.

Future works
To music emotion recognition, it is better to use music features such as rhythm, melody to get the exact feeling to users Review more on Sinhala language contents which write in English letters because most social media users have used Sinhala contents with English letters. Try on more complex emotional categories detection to identified extract therapy users need. It is better to give a choice of songs that is related to users' emotion so users have the freedom to select any songs as they wish. To improve the Sinhala emotion detection accuracy it is better to use a unique dataset that covers all the emotional categories. Improve to other language aspects