Using word2vec to Semantically plot Self-Improvement

Karl Fezer
Intel Software Innovators
6 min readFeb 21, 2019
My brain map is mostly dominated by “Cheetos”

It’s a new year, so everyone needs to be making themselves “better.” Also, you might notice this is getting posted in February, so I should also work on “punctual.” To get started, just to give you an example of ways in the new year I want to improve (as related to ML):

Increase my learning rate → Read more

Increase my data set → experience more things/ get more friends

Update my version →become a better human

Add more convolutional layers → focus on what matters

Even more than that, there have been a lot of articles around quantifying yourself and trying to set specific goals, so I did that.

A lot of the motivation for this might be due to my new choice in reading, so take the following article and motivation with that in mind. My currently reading list consists of both Measure What Matters and Solve for Happy. Note: I definitely make no money on book referrals. If you ever wanted to get a perfect starting guide to how to engineer your way to happiness, definitely would recommend these two books.

This is also heavily motivated by my friend Shashi’s post here. If you want to get into the details and see his great approach, I recommend reading his full article. I took a similar idea but a very different approach. Some might say “unsuccessful,” but I say “novel.”

Here’s the main gist; trying to understand where you are and where you want to go as a person. To do this, come up with a list of 3 adjectives you want to set as goals. Then, survey people who know you and get a list of 3 adjectives as they describe you. Once you have those, you actually have 3 nice descriptors (tuples) that describe you in terms of where you are and where you want to be.

This lead me to think about what to do with that information. It would be easier to act on if I were able to plot out the difference between those words and find checkpoints on the way. Semantically. So I did. How? word2vec of course!

If you don’t know what word2vec is, check out the link above or Google it. word2vec is a vectorization of words that are related semantically. It’s a great way to semantically represent words in multi-dimensional space. It’s trained using Deep Learning, but we won’t get into that part here. There are countless other articles already about that. I want to use those vectorizations so that I can quantify meaning.

Dr. Nick is also an Inspiration for this work

This starts with first coming up with my 3 adjectives that I want as a goal.

My 3 Goal Adjectives:

  • Compassionate
  • Innovative
  • Entertaining

I then sent out a survey to friends/co-workers/ strangers on the subway to come up with a list of adjectives that describe me. Here are the results:

My top adjectives; surprisingly “stop talking to me, I don’t know you” didn’t show up

You can see there’s a lot of similar words, so I took some liberties in grouping and summing them up. I then picked the top 3:

  • Friendly
  • Funny
  • Intelligent

That’s not too far off of my goal words of compassionate, innovative, and entertaining. Good start!

My goal is then to use the word vectors in word2vec to be able to visually plot a semantic path between all of the current words to the goal words. For this, I wrote a bit of code to assign them automatically based on the semantic distance between them, but then also adjusted it for personal preference. I ended up with these related adjectives.

Friendly → Compassionate

Funny → Entertaining

Intelligent → Innovative

Now that I have that, we can do a quick chained search that plots a path between these words. We end up with:

['friendly', 'congenial', 'detecting_gastrointestinal_disorders', 'congenial', 'compassionate']
['funny', 'amusing', 'hilarious', 'entertaining']
['intelligent', 'intuitive', 'Telkonet_SmartEnergy_TSE', 'user_friendly', 'innovative']

To see what that looks like in three dimensions:

Great! …

It’s actually slightly disappointing. The goal words are really pretty close to what my current words are. For example, to get to “entertaining” from “funny”, I have to go through hilarious. So I need to work on my comedy routine. That doesn’t sound rewarding at all. And to get to “innovative” I need to get to “user_friendly”. I hate users. I want to really do some deep growth this year, so let’s mix it up.

New Goal Words (V2):

  • Filthy Rich
  • Astronaut
  • Batman

Now, I know that “Batman” also includes the concepts of “filthy rich” and is a bit close to “astronaut” depending on which comic you’re looking in, but I want to make sure I hit ALL of these goals. So let’s get our new semantic word paths:

['friendly', 'freindly', 'freindly', 'batman']
['funny', 'McCatty_pretended', 'found_loophole_Conk', 'astronaut']
['intelligent', 'fraudulant_stuff', 'erudite', 'filthy_rich']

Bam! Look at that! From “Friendly” to “Batman” in 1-ish easy steps! I can do that. Let’s see what that looks like on our graph:

Batman is known for his friendly demeanor

And another!

get smart; make money

Hmmm.. only one of these really makes sense, and it’s how to get rich:

Step 1: Be Intelligent

Step 2: Do some fraudulent stuff

Step 3: Become erudite in some way

Step 3: Profit

Great! On my way to being a mega-rich, super-hero space-pirate! Next steps for me involve w̶r̶i̶t̶i̶n̶g̶ ̶a̶ ̶n̶o̶v̶e̶l̶ stealing a rocketship to inspire everyone to follow my path.

Contact information not provided…

That’s really it. We didn’t really get an easy-to-follow path for becoming our better selves, but we did play around with word2vec and get some visualizations en-route. Feel free to play around with this on your own. The full code is here:

Also, please check out the original articles that inspired me to become Batman. They’re much better written and actually can help you reach goals!

Finally, if you want to see semantic proof of the above “flammable” vs “inflammable” gif, here you go:

--

--

Karl Fezer
Intel Software Innovators

Wanna think about our soon-to-be Robot-Overlords and hear about my adventures in meat-space?