Skip to main content

David's HappyGram

Photos from Unsplash users left to right, top to bottom: Xavier Mouton Photographie, cihan soysakal, Chris Lawton, Jason Leung.

How was this made?

First, we took the text of your happy moment:

I saw my son splashing in the pool on video chat. It was good to see him having fun with his grandparents and learning to enjoy the water because he's been afraid of it in the past.

Identify Entities and Syntax

What it is:
We take that text and run it through the Google Cloud Natural Language API. This provides a variety of natural language analysis, including the identification of entities ordered by salience (or importance) and a wide variety of parts of speech.

What we do with it:
We extract the "entities" and syntax to search for images. Entities are the nouns that are identified by Google's API. We are also provided syntax analysis of all the content, and from that we link verbs to nouns to make better image searches.
I saw my son1 splashing in the pool2 on video chat3 . It was good to see him having fun4 with his grandparents5 and learning to enjoy the water6 because he's been afraid of it in the past.

Entity

Salience

Entity Type

1.son Person 2.pool Location 3.video chat Other 4.fun Other 5.grandparents Person 6.water Other

We link nouns and verbs together to return better image search results. For instance, we create the entity group "ride horse" instead of just the entity "horse". Something to keep in mind is the image search results are only as strong as the images available. In this case, we're querying Unsplash, a free, crowd-sourced database of photographs.

Determine Sentiment

What it is:
Sentiment analysis identifies the leading emotional opinion, which can be used to determine the attitude as positive, negative, or neutral.

What we do with it:
Adjust the saturation of images. Images with a more positive sentiment will be more saturated, conversely we desaturate more negative sentiment.

Sentiment Score: 0.5 (Positive)

-1.0 to -0.25 -0.25 to 0.25 0.25 to 1.0
0.5

Categorize

What it is:
AutoML is an API platform provided by Google to create custom machine learning models. You simply upload data, categorize representative parts of the data, and Google will process the data and allow evaluation on any arbitrary input to match to your data labels.

What we do with it:
We have created a model that uses nearly 20,000 categorized happy moments taken from users online to evaluate your moment into one of the seven different categories. We have assigned Instagram-like filters to each category so that all happy moments from each category share a similar look.

This moment's category relevance

Use the slider to view image before (left) and after (right) applying filter based on category.

How Machine Learning Can Help Your Organization

This experiment is fun, but the real purpose we built it was to explore the many ways we can harness machine learning to revolutionize content creation for all kinds of content platforms. How could it help your organization?

Learn More