For too long, computers have appeared cold, unfeeling, and inaccessible to those unfamiliar with them. We decided to change that. What if your computer felt the same emotions you did? While computer feelings may be far off, we can create that illusion. By making it seem like your machine empathizes with your current mood, technology becomes more accessible, with wide-ranging applications from education to the elderly. Many who don't use computers today are intimidated, feeling that such cold, "judging"

What it does

Five years ago, artificial intelligence seemed like science-fiction. Today, with the enormous advances made by the field of machine learning, the future doesn't seem so far off. We as a team are fascinated with this power, and sought to use the power of natural-language processing, driven by machine learning, to build a deployable app.

EmoType provides an empathetic partner for whatever mood you may be in. As you type, your words are analyzed and associated with different emotions, which we then reflect. If you're feeling down, the background will gracefully darken and EmoType will begin to play "rainy day" music along with you*. If you're full of joy in your writing, your screen will overflow with color as upbeat music fills your ears. No matter how you're feeling, EmoType will empathize, bringing a warm and welcoming feel to what previously seemed like just a hunk of metal.

How we built it

EmoType is a text editor built as a Chrome extension, with a backend hosted on Heroku and written in Node.js. Styling and color control is completed using CSS, while audio is provided by Spotify. In order to detect emotions, our editor batch puts inputted text (delineated by punctuation) into the AlchemyAPI for natural language processing-based emotion analysis of that text. We then examine the emotion weights in order to determine a dominant sentiment, or choose a neutral one if none emerges.

Once we know the mood of the user, the magic begins to come together. Information about the mood is sent to our CSS file for background coloring as well as to our cloud server for the creation of a custom Spotify playlist. We have a curated database of playlists to choose from, and select one based on the user's current mood. We then randomly select a song from this playlist, and add that song to the active play queue. When it all comes together, EmoType runs smoothly and gracefully, putting a more human face on the technology we use every day.

Challenges we ran into

This was a highly challenging and technically demanding project. Challenges we encountered and overcame included handling complex OAuth permissions requiring input from end-users, handling of malformed/poorly documented API returns, and theming/repainting based on emotions. All of these problems forced us to leverage both our creativity and problem-solving ability as we worked together towards our ultimate goal, and without the work we put into these areas, EmoType would not have been successfully deployed.

Accomplishments that we're proud of

Some of our greatest accomplishments in the development of EmoType were the successful handling of theming and our integration with Spotify. The theming aspect was technically demanding, both in terms of theme selection and CSS transitions. Through careful attention to detail, we were able to craft solutions that melded well with detected emotions while providing a near-seamless UI. Spotify integration proved to be a challenge for different reasons. First, the Spotify node.js API included several significant errors that precluded the use of a traditional JSON parse, so we were forced to custom parse each returned dataset from the API. Second, playlist construction turned out to be a significant challenge, and we were proud to eventually successfully create and manipulate custom playlists that change dynamically with user moods. Further complicating matters, the Spotify Web API was inconsistent in its handling of permissions errors, resulting in a mysterious bug that took us several hours to chase down. Overall, however, we are proud that in 36 short hours we were able to generate a working application that we believe has the potential to impact those around us in a tangible way.

What we learned

All of us learned a great deal on this project. While our previous hackathon experience varied widely, we all gained something out of building EmoType. Whether new languages (like node.js), new APIs, or new debugging techniques, EmoType tested all of our abilities to their fullest. In addition, we learned techniques for optimizing our API calls, handling large JSONs, and batch putting text. No matter the challenge at hand, we loved the opportunity to delve into and solve a problem we observed in the world.

What's next for EmoType

*as of 8:52AM pending new access to original Heroku site/fix to Spotify API (requires original site, which we are currently locked out of)

Share this project: