## Inspiration

We're computer science students, need we say more?

## What it does

"Single or Nah" takes in the name of a friend and predicts if they are in a relationship, saving you much time (and face) in asking around. We pull relevant Instagram data including posts, captions, and comments to drive our Azure-powered analysis. Posts are analyzed for genders, ages, emotions, and smiles -- with each aspect contributing to the final score. Captions and comments are analyzed for their sentiment, which give insights into one's relationship status. Our final product is a hosted web-app that takes in a friend's Instagram handle and generate a percentage denoting how likely they are to be in a relationship.

## How we built it

Our first problem was obtaining Instagram data. The tool we use is a significantly improved version of an open-source Instagram scraper API (<https://github.com/rarcega/instagram-scraper>). The tool originally ran as a Python command line argument, which was impractical to use in a WebApp. We modernized the tool, giving us increased flexibility and allowing us to use it within a Python application.

We run Microsoft's Face-API on the target friend's profile picture to guess their gender and age -- this will be the age range we are interested in. Then, we run through their most recent posts, using Face-API to capture genders, ages, emotions, and smiles of people in those posts to finally derive a sub-score that will factor into the final result. We guess that the more happy and more pictures with the opposite gender, you'd be less likely to be single!

We take a similar approach to captions and comments. First, we used Google's Word2vec to generate semantically similar words to certain keywords (love, boyfriend, girlfriend, relationship, etc.) as well as assign weights to those words. Furthermore, we included Emojis (is usually a good giveaway!) into our weighting scheme[link](https://gist.github.com/chrisfischer/144191eae03e64dc9494a2967241673a). We use Microsoft's Text Analytics API on this keywords-weight scheme to obtain a sentiment sub-score and a keyword sub-score.

Once we have these sub-scores, we aggregate them into a final percentage, denoting how likely your friend is single. It was time to take it live. We integrated all the individual calculations and aggregations into a Django., then hosted all necessary computation using Azure WebApps. Finally, we designed a simple interface to allow inputs as well as to display results with a combination of HTML, CSS, JavaScript, and JQuery.

## Challenges we ran into

The main challenge was that we were limited by our resources. We only had access to basic accounts for some of the software we used, so we had to be careful how on often and how intensely we used tools to prevent exhausting our subscriptions. For example, we limited the number of posts we analyzed per person. Also, our Azure server uses the most basic service, meaning it does not have enough computing power to host more than a few clients.

The application only works on "public" Instagram ideas, so we were unable to find a good number of test subjects to fine tune our process. For the accounts we did have access to, the application produced a reasonable answer, leading us to believe that the app is a good predictor.

## Accomplishments that we're proud of

We proud that we were able to build this WebApp using tools and APIs that we haven't used before. In the end, our project worked reasonably well and accurately. We were able to try it on people and get a score which is an accomplishment in that. Finally, we're proud that we were able to create a relevant tool in today's age of social media -- I mean I know I would use this app to narrow down who to DM.

## What we learned

We learned about the Microsoft Azure API (Face API, Text Analytics API, and web hosting), NLP techniques, and full stack web development. We also learned a lot of useful software development techniques such as how to better use git to handle problems, creating virtual environments, as well as setting milestones to meet.

## What's next for Single or Nah

The next steps for Single or Nah is to make the website and computations more scalable. More scalability allows more people to use our product to find who they should DM -- and who doesn't want that?? We also want to work on accuracy, either by adjusting weights given more data to learn from or by using full-fledged Machine Learning. Hopefully more accuracy would save "Single or Nah" from some awkward moments... like asking someone out... who isn't single...
## Inspiration

Sweet Tweetment lets you check up on your friends who need it the most. We were inspired to do this to solve two major problems:

1) In the digital age, we're following so many people on social media sites such as Twitter that we're unable to manually keep up with everyone we care about

2) Mental health issues are on the rise (especially on college campuses and among youth), and bullying has become very prevalent on social media

We wanted to solve these problems by automating the process of checking up on your friends.

## What it does

Sweet Tweetment finds all of the people you follow, and searches for whether you should reach out to them because they've been suffering in some way or are at risk in the future. Our application uses sentiment analysis to read in your friends' tweets, classify them, and suggest a means to reach out to those in need. We use machine learning make our recommendations predictive and reactive, so you can find friends at risk based on current trends, or friends who have already experienced some traumatic events. Our app can also identify whether your friends are being bullied, and can direct you to tools to help them to #HackHarrassment. You can even create an account, and tweet your friends to check up on them right form the website!

## How we built it

The frontend is built with AngularJS, HTML, and CSS. The user can log in to their twitter account through our site which uses the Twitter API and OAuth to return a list of all the people they are following. They can select all friends who they would like to check up on (for harassment and well-being).

The backend is built in Node Express, and uses the Twitter API to get lists of followers and recent tweets. This data is source dto IBM Watson's (Bluemix) emotional analysis platform (Alchemy API) to determine how sad or aggressive the messages were. Based on the emotional analysis, each tweet is scored and this information is fed through a machine learning linear regression framework to predict how sad their subsequent posts will be (i.e. the future emotional state of the user), and gather how sad posts have been on average previously.

A similar process is used to determine online harassment. The tweets that are sent to their friends are emotionally analyzed for the anger sentiment and if an overwhelming amount of their tweets are classified as being “angry or aggressive” (based on the emotional analysis results), the friend is classified as being a target of online bullying.

The app is hosted using Linode.

## Challenges we ran into

You can run the same code and have it stop working.

## Accomplishments that we're proud of

-Empowering people to help their friends in need
-Helping create new avenues to find and stop bullying

## What we learned

You can run the same code and have it stop working!

## What's next for tweethacks

We're hoping to have users log into the website once, and send them emails whenever any of their friends appears to be struggling in any way to make Sweet Tweetment even more user friendly!
## A bit about our thought process...

If you're like us, you might spend over 4 hours a day watching *Tiktok* or just browsing *Instagram*. After such a bender you generally feel pretty useless or even pretty sad as you can see everyone having so much fun while you have just been on your own.

That's why we came up with a healthy social media network, where you directly interact with other people that are going through similar problems as you so you can work together. Not only the network itself comes with tools to cultivate healthy relationships, from **sentiment analysis** to **detailed data visualization** of how much time you spend and how many people you talk to!

## What does it even do

It starts simply by pressing a button, we use **Google OATH** to take your username, email, and image. From that, we create a webpage for each user with spots for detailed analytics on how you speak to others. From there you have two options:

       **1)** You can join private discussions based around the mood that you're currently in, here you can interact completely as yourself as it is anonymous. As well if you don't like the person they dont have any way of contacting you and you can just refresh away!

       **2)** You can join group discussions about hobbies that you might have and meet interesting people that you can then send private messages too! All the discussions are also being supervised to make sure that no one is being picked on using our machine learning algorithms

## The Fun Part

Here's the fun part. The backend was a combination of **Node**, **Firebase**, **Fetch** and **Socket.io**. The ML model was hosted on **Node**, and was passed into **Socket.io**. Through over 700 lines of **Javascript** code, we were able to create multiple chat rooms and lots of different analytics.

One thing that was really annoying was storing data on both the **Firebase** and locally on **Node Js** so that we could do analytics while also sending messages at a fast rate!

There are tons of other things that we did, but as you can tell my **handwriting sucks....** So please instead watch the youtube video that we created!

## What we learned

We learned how important and powerful social communication can be. We realized that being able to talk to others, especially under a tough time during a pandemic, can make a huge positive social impact on both ourselves and others. Even when check-in with the team, we felt much better knowing that there is someone to support us. We hope to provide the same key values in Companion!