Word Morphing

Yoel Zeldes
Towards Data Science
5 min readApr 28, 2018

--

Smooth image transition (morphing) from a tiger to a human (image courtesy: Google Images)

In this post I’ll describe how I employed word2vec’s embeddings and A* search algorithm to morph between words.

In order to perform word morphing, we’ll define a graph G where the set of nodes N represent words, and there’s some non negative weight function f:N×N→ℝ. Given a start word S and an end word E, our goal is to find a path within the graph which minimizes the sum of weights induced by f:

--

--