Skip to content

Analyses the mood of a person from updates on social media platforms

License

Notifications You must be signed in to change notification settings

apeeyush/MoodY-Trudes

Repository files navigation

MoodY! Trudes

The basic purpose of this application is to analyse the moods of a person over a certain period of time based on his updates on any social media platform. Based on this, it will plot a graph of the person’s mood swings against time (the graph was made using YUI). It was also used to suggest music and images to a person according to his/her mood in the Yahoo HackU competition. What differentiates this app from the standard sentiment analysis based applications is the fact that it is individual centric instead of being used for determination of the general sentiment towards a particular product, movie, etc. And it is also more subjective in predicting the mood.

For mood prediction in the hack, we extracted the social networking data of a person (like Facebook posts) using a pthon script [fb.py]. This data which is stored in update.txt is then run through the already trained LibSVM algorithm on the terminal which predicts the mood of a person (happy, sad, excited and angry were the four broad categories that we used). For training the LibSVM algorithm, we had to created a training corpus since we couldn’t have a ready-made dataset for such a purpose[The data was available but it was not classifierd into four categories as reqired]. we used Twitter tweets, which we categorized into the above four categories. Thereafter we parsed the complete training data to identify and segregate all the words present in it. We reduces the feature vector size by using nltk’s pos tagging to identify the parts of speech that may be useful in determinig the emotion of the person[Things like conjunctions, prepositions etc. that are not useful were removed]. We also removed the words whose count were very less or very much to reduce the vecor size. The final vector size came out to be around 500. Now we made the training vectors by converting each tweet in a vector. The code for this is available in extract.py.

We ran a crontab on terminal which calls the sheell script [automate.sh] every five minutes. Once the fb.py updates the status in update.txt, the trained SVM classifie it into one of the four categories. Then it passes on this data to a web app which was temporarily hosted on hackyourworld.org during the event. This web app then suggests a music for the person based on the mood and changes the background image. It also plots a graph of the mood of the person over a period of time.

PS : The codes written here are not commented since they were written during a 24 hour hack-a-thon.

About

Analyses the mood of a person from updates on social media platforms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages