## Overview

How we understand and communicate to those around us shapes and determines the person we are. In order to help people better understand the sentiments behind their words, we have incorporated the NLTK sentiment analysis tool to learn and interpret the positive, negative, and neutral meanings behind our words. In addition to d3js illustrations, integration in Moxtra allows for a commonplace setting for different users to benefit from the app.

The data is provided in three graphs: sentiment analysis of messages sent, sentiment analysis of messages received, and sentiment analysis over the course of using the website in hopes to help better become more aware of their words and surroundings, to improve the ways that people communicate, and to provide useful and meaningful data where necessary.

## Challenges

The areas that we spent the most time on were actually in planning, incorporating Moxtra, and deploying to Azure. We actually encountered an interesting bug with the Moxtra API with user authentication after hours of slamming against it and had a great experience bringing it to the attention of one of the Moxtra engineers to find a workaround. Azure server setup with Flask was streamlined once talking with a helpful mentor - with most of the initial issues cause by hardware setup differences.

## What's Next?

Mobile, more robust messaging, stronger analysis tools are all awesome features we would like to see!
However, when we narrowed down the features to one item we would like to work on, we decided ultimately on the ability to retroactively review ALL messages in order to obtain an instant break down of communication over time and to observe any trends over time.
## Inspiration

In a world where a tweet out of context can cost you your career, it is increasingly important to be in the right, but this rigidity alienates a productive and proud group of people in the world--the impulsive. Politically Correct is a solution for those who would risk a slap for a laugh and who would make light of a dark situation.

The question of whether we have stepped too far over the line often comes into our minds, sparking the endless internal debate of "Should I?" or "Should I not?" Politically Correct, leveraging both artificial and natural intelligence, gives its users the opportunity to get safe and effective feedback to end these constant internal dialogues.

## What it does

Through a carefully integrated messaging backend, this application utilizes Magnet's API to send the text that the user wants to verify to a randomly selected group of users. These user express their opinion of the anonymous user's statement, rating it as acceptable or unacceptable. This application enhances the user's experience with a seamless graphical interface with a "Feed" giving the user messages from others to judge and "My Questions" allowing users to receive feedback. The machine learning component, implemented and ready to be rolled out in "My Questions", will use an Azure-based logistic regression to automatically classify text as politically correct or incorrect.

## How I built it

Blood, sweat, tears, and Red Bull were the fuel that ignited Politically Correct. Many thanks to the kind folks from Magnet and Azure (Microsoft) for helping us early in the morning or late at night. For the build we utilized the Magnet SDK to enable easy in-app messaging and receiving between users and a random sample of users. With the messages, we added and triggered a message 'send-event' based on the click of a judgement button or an ask button. When a message was received we sorted the message (either a message to be judged or a message that is a judgement). To ensure that all judgement messages corresponded to the proper question messages we used special hash ids and stored these ids in serialized data. We updated the Feed and the MyQuestions tab on every message receive.

For Azure we used logistic regression and a looooooooonnnnnnnnggggggg list of offensive and not offensive phrases. Then after training the set to create a model, we set up a web api that will be called by Politically Correct to get an initial sentiment analysis of the message.

## Challenges We ran into

Aside from the multiple attempts of putting foot in mouth, the biggest challenges came from both platforms:
**Azure**: *Perfectionism*
While developing a workflow for the app the question of "How do I accurately predict the abuse in a statement?" often arose. As this challenge probably provokes similar doubts from Ph.Ds we would like to point to perfectionism as the biggest challenge with Azure.

**Magnet:** *Impatience*
Ever the victims, we like to blame companies for putting a lot of words in their tutorials because it makes it hard for us to skim through (we can't be bothered with learning we want to DO!!). The tutorials and documentation provided the support and gave all of us the ability to learn to sit down and iterate through a puzzle until we understood the problem.
It was difficult to figure out the format in which we would communicate the judgement of the random sample of users.

## Accomplishments that I'm proud of

We are very proud of the fact that we have a fully integrated Magnet messaging API, and the perfect implementation of the database backend.

## What I learned

Aside from the two virtues of "good enough" and "patience", we learned how to work together, how to not work together, and how to have fun (in a way that sleep deprivation can allow). In the context of technical expertise (which is what everyone is going to be plugging right here), we gained a greater depth of knowledge on the Magnet SDK, and how to create a work flow and api on Azure.

## What's next for Politically Correct

The future is always amazing, and the future for Politically Correct is better (believe it or not). The implementation for Politically Correct enjoys the partial integration of two amazing technologies Azure and Magnet, but the full assimilation (we are talking Borg level) would result in the fulfillment of two goals:
1) Dynamically train the offense of specific language by accounting for the people's responses to the message.
2) Allow integrations with various multimedia sites (i.e. Facebook and Twitter) to include an automatic submission/decline feature when there is a consensus on the statement.
## Inspiration

Going home for winter break and seeing friends was a great time, but throughout all the banter, I realized that our conversations often took a darker turn, and I worried for my friends' mental health. During the school year, it was a busy time and I wasn't able to stay in touch with my friends as well as I had wanted to. After this realization, I also began to question my own mental health - was I neglecting my health?

We were inspired to build a web app that would increase awareness about how friends were doing mentally that could also provide analytics for ourselves. We thought there was good potential in text due to the massive volumes of digital communication and how digital messages can often reveal some the that may be hidden in everyday communication.

## What it does

It parses user text input into a sentiment score, using Microsoft Azure, where 0 is very negative and 1 is very positive. Over a day, it averages the input for a specific user and logs the text files. Friends of the user can view the weekly emoji graphs, and receive a text message if it seems like the user is going through a rough spot and needs someone to talk to.

We also have an emoji map for displaying sentiments of senders around the world, allowing us to see events that invoke emotional responses in a particular area. We hope that this is useful data for increased global and cultural awareness.

## How we built it

We used React.js for the front-end and used Flask with Python for the backend. We used Azure for the sentiment analysis and Twillio to send text messages.

## Challenges we ran into

One of the biggest bottlenecks was connecting our front-end and back-end. Additionally, we had security concerns regarding cross origin resource sharing that made it much more difficult to interface with all the different databases. We had too many APIs that we wanted to connect that made things difficult too.

## Accomplishments that we're proud of

We were able to create a full-stack app web app on our own, despite the challenges. Some of the members of the team had never worked on front-end before and it was a great, fun experience learning how to use JS, Flask, and HTML.

## What we learned

We learned about full stack web app development and the different languages required. We also became more aware of the moving parts behind a web app, how they communicate with each other, and the challenges associated with that.

## What's next for ment.ally

Our original idea was actually a Chrome extension that could detect emotionally charged messages the user types in real-time and offer alternatives in an attempt to reduce miscommunication potentially hurtful to both sides. We would like to build off of our existing sentiment analysis capabilities to do this. Our next step would be to set up a way to parse what the user is typing and underline any overly strong phrases (similar to how Word underlines misspelt words in red). Then we could set up a database that maps some common emotionally charged phrases with some milder ones and offers those as suggestions, possibly along with the reason (e.g. "words in this sentence can trigger feelings of anger!).