Elior Cohen

This article is about the MaLSTM Siamese LSTM network (link to article on the second paragraph) for sentence similarity and its appliance to Kaggle’s Quora Pairs competition.
I will do my best to explain the network and go through the Keras code (if you are only here for the code, scroll down 🙂
Full code on github

In the past few years, deep learning is all the fuss in the tech industry.
To keep up on things I like to get my hands dirty implementing interesting network architectures I come across in article readings.Few months ago I came across a very nice article called Siamese Recurrent Architectures for Learning Sentence Similarity which offers a pretty straightforward approach at the common problem of sentence similarity.
Named MaLSTM (“Ma” for Manhattan distance), its architecture is depicted in figure 1 (diagram excludes the sentence preprocessing part).
Notice that since this is a Siamese network, it is easier to train because it shares weights on both sides.