Inspiration

Inspired by those with Asperger's, Sentimentex is the idea of Siyuan Liu, Faazilah Mohamed, and Saniyah Shaikh at PennApps xvi (Fall 2017). It aims to help those who have a hard time discerning the emotions from texts, emails, and other text-based media by using machine learning, natural language processing, and webscraping to calculate the percentages of emotions present in the given text.

What it does

Sentimentex takes in text from the user and returns the probabilities of predictions for emotions present in that text, including joy, disgust, anger, fear, sadness, and guilt. Most of the current sentiment analyzers simply detect whether a sentence is positive, negative, and neutral, and we believe that a more fine-grained classifier can be useful for a variety of reasons, including for those with disabilities.

How I built it

Over 7,000 entities of labelled data were used from a repo. A machine learning classifier, SVM, was trained on the labelled data and then used to predict the emotions for a user-inputted text. Other scores, such as the sentiment rating (whether a sentence is positive, negative, or neutral) and the sentiment score outputted by Google Natural Language Processing API, were considered as features but ultimately did not turn out to be promising. The code for the project was primarily in Python, though R, Javascript, and HTML/CSS were used as well.

Challenges I ran into

The biggest challenge was incorporating Python with HTML using Flask. Since none of the members of the team have significant front-end experience, a fair bit of time was spent trying to get the Flask app to be hosted and work.

Accomplishments that I'm proud of

Our model is able to predict between the 7 emotions in consideration with over 3x the accuracy of predicting at random. We are also proud of managing to integrate Python with the web application since this is the first time we have attempted to do that.

What I learned

We learned the cases in which to use certain Machine Learning models, interacted with multiple APIs from the Google Cloud service, and learned how to use Flask and Javascript for the very first time.

What's next for Sentimentex

All of us are very excited for the prospect of using Machine Learning and Natural Language Processing to capture the essence of written text. We plan on continuing to experiment with larger datasets and different features to improve the accuracy score of a given text, as well as to look into Speech APIs for fine-grained sentiment analysis as well.

Share this project:

Updates