## 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

* 2020 US Census survey showed that adults were 3x more likely to screen positive for depression or anxiety in 2020 vs 2019
* A 2019 review of 18 papers summarized that wearable data could help identify depression, and coupled with behavioral therapy can help improve mental health
* 1 in 5 americans owns wearables now, and this adoption is projected to grow 18% every year
* Pattrn aims to turn activity and mood data into actionable insights for better mental health.

## 🤔 What it does

* Digests activity monitor data and produces bullet point actionable summary on health status
* Allows users to set goals on health metrics, and provide daily, weekly, month review against goals
* Based on user mood rating and memo entry, deduce activities that correlates with good and bad days
[![Screen-Shot-2022-10-16-at-1-09-40-PM.jpg](https://i.postimg.cc/MZhjdqRw/Screen-Shot-2022-10-16-at-1-09-40-PM.jpg)](https://postimg.cc/bd9JvX3V)

[![Fire-Shot-Capture-060-Pattrn-localhost.png](https://i.postimg.cc/zBQpx6wQ/Fire-Shot-Capture-060-Pattrn-localhost.png)](https://postimg.cc/bDQQJ6B0)

## 🦾 How we built it

* Frontend: ReactJS
* Backend: Flask, Google Cloud App Engine, Intersystems FHIR, Cockroach Labs DB, Cohere

## 👨🏻‍🤝‍👨🏽 Challenges / Accomplishments

* Ideating and validating took up a big chunk of this 24 hour hack
* Continuous integration and deployment, and Github collaboration for 4 developers in this short hack
* Each team member pushing ourselves to try something we have never tried before

## 🛠 Hack for Health

* Pattrn currently is able to summarize actionable steps for users to take towards a healthy lifestyle
* Apart from health goal setting and reviewing, pattrn also analyses what activities have historically correlated with "good" and "bad" days

## 🛠 Intersystems Tech Prize

* We paginated a GET and POST request
* Generated synthetic data and pushed it in 2 different time resolution (Date, Minutes)
* Endpoints used: Patient, Observation, Goals, Allergy Intolerance
* Optimized API calls in pushing payloads through bundle request

## 🛠 Cockroach Labs Tech Prize

* Spawned a serverless Cockroach Lab instance
* Saved user credentials
* Stored key mapping for FHIR user base
* Stored sentiment data from user daily text input

## 🛠 Most Creative Use of GitHub

* Implemented CICD, protected master branch, pull request checks

## 🛠 Cohere Prize

* Used sentiment analysis toolkit to parse user text input, model human languages and classify sentiments with timestamp related to user text input
* Framework designed to implement a continuous learning pipeline for the future

## 🛠 Google Cloud Prize

* App Engine to host the React app and Flask observer and linked to Compute Engine
* Hosted Cockroach Lab virtual machine

## What's next for Pattrn

* Continue working on improving sentiment analysis on user’s health journal entry
* Better understand pattern between user health metrics and daily activities and events
* Provide personalized recommendations on steps to improve mental health
* Provide real time feedback eg. haptic when stressful episode are predicted

Temporary login credentials:
Username: [norcal2@hacks.edu](mailto:norcal2@hacks.edu)
Password: norcal
## Inspiration

With recent concerns over popular social media influencers posting inappropriate and questionable content for their followers to see, it has become vastly more difficult for parents to monitor the content that their children consume. With this in mind, we set out to build a platform that would enable parents to easily keep a\_ watchful eye \_on the social media content their children are exposed too.

## What it does

Watchful AI is a web app where parents can enter their child's Instagram username in order to monitor their online consumption. Watchful AI extracts a list of the users they are following and then uses machine learning on each user's most recent posts and classifies the image as either safe or unsafe. Watchful AI can also handle video content and provide a rating of how safe the video is.

## How we built it

We knew we wanted to use stdlib to run the analysis of the images so we started there. We started by creating a stdlib function for analysing an image and calculating a "safety" score (how "good" the image was). Then we began working on the node.js back to get the Instagram API to work. We discovered that the API did not offer the ability to find who a certain user was following so we had to use another platform to extra that data. We used Parsehub to scrape the usernames of the followers and then we used the Instagram API to get some of the last posts. The API limits us to 20 posts max and we can only access the posts from people in our "sandbox". So this hack currently only works with a select number of accounts, we would need to submit the app for review before it can be applied to any account. Once the backend was interacting with the API and stdlib functions correctly we added a front-end built on Bootstrap and jQuery. Overall the hack serves as a great proof of concept!

## Challenges we ran into

* The Instagram API is incredibly limited and made it a challenge to accomplish anything.
* The Instagram API doesn't allow us to retrieve a user's following list, thus we had to scrape the web page to acquire that data
* We ran out of stdlib credits
* The stdlib timeouts were a problem and forced us to restructure our calls.

## Accomplishments that we're proud of

We managed to get a mostly working web app even though we both had very limited to no experience with web design and javascript. We are also quite pleased with the accuracy of the model we trained.

## What we learned

* How to use stdlib
* How to use Clarifai
* Instagram sucks

## What's next for Watchful AI

We would like to implement similar functionality for other social media sites such as Twitter, Facebook and Youtube. As well as improving the accuracy of the prediction model.