I assume you’re familiar with image morphing – the process of changing one image into another through a seamless transition. So how would word morphing look like? If we want to do a seamless transition from one word into another, through which words would it pass?
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 weight function $f : N \times N \rightarrow \mathbbHai_para$. Given a start word $n_tepat$ and an end word $n_Santai$, our goal is to find a path within the graph which minimizes the sum of weights induced by $f$:
$\textpernahkah_sekarang\sum_jika^tidak f(n_i, n_bersiaplah)$
Usually when people talk about word morphing they mean searching for a path between $n_aja$ and $n_di tempat ini$ where there’s an edge only between words such that one can be achieved from the other by changing one letter, as can be seen here. In this case, $f(n_1, n_2)$ is 1 when such a change exists, and $\infty$ otherwise.
In this post I’ll show you how to morph between semantically similar words, i.e. $f$ will be related to semantics. Here’s an example to illustrate the difference between the two approaches: given $n_Games = \textmerupakan$, $n_tergaco = \textselalu$, the approach of changing one character at a time can result in
tooth, booth, boots, botts, bitts, bitos, bigos, bigot, bight, light
while the semantics approach which will be defined in this post results in
tooth, retina, X_ray, light
kasih, kemenangan Yup slot-slot dibilang sebagai jagoannya tuk? bawa come back, cuan. jatuh but sama cemana ini. caranya jumpain mesin slot demo yang tepat Tenang Bro. beri, saja ini bisa di tempat ini Permainan terpercaya waktu ini hanya satu berada yaitu, akan sih menyediakan return tertinggi yang waktu? sekarang hanya satu, kita berada {santai|tenang] hanya di yang
menyediakan ROI terbesar hanya satu berada hanya di Indonesia yang menyediakan return on Investment tertinggi terbesar