Not the author, but I&#x27;m guessing it uses an implementation of &quot;Grammar as a Foreign Language&quot;[1].<p>TensorFlow has a tutorial that gets you most of the way[2].<p>Edit: playing a bit I don&#x27;t think it is doing this. I think it&#x27;s using Word2Vec style vectors to build similar sentences, and calculating the probability of each and maybe the edit-cost to change.<p>[1] <a href="http:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1412.7449" rel="nofollow">http:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1412.7449</a><p>[2] <a href="https:&#x2F;&#x2F;www.tensorflow.org&#x2F;versions&#x2F;master&#x2F;tutorials&#x2F;seq2seq&#x2F;index.html#what-next" rel="nofollow">https:&#x2F;&#x2F;www.tensorflow.org&#x2F;versions&#x2F;master&#x2F;tutorials&#x2F;seq2seq...</a>