Solved – recurrent neural networks for sentence similarity

classificationdeep learningnatural languagerecurrent neural network

I have two sentences and I want to use RNNs to check whether the second sentence expresses a positive or a negative sentiment towards the first sentence. The two sentences can have different length.

What type of RNN should I use?

  1. one-to-many RNN architecture with the word vectors for the two sentences separated by a delimiter? (i.e. w1_s1 w2_s1 … wn_s1 :: w1_s2 … wm_s2). Is it possible to have a delimiter as input in RNNs ("::" in the example)?
  2. siamese RNNs with an RNN for each sentence? Given that I don't want to test the similarity between sentences, can siamese RNNs be used in my case?
  3. A different RNN architecture that I have not listed here?

Best Answer

Jenna Bellassai has a library that should work for you. It tests for similarity of two phrases using AvMax cosine similarity using the Word2Vec model. She relies on the Word2Vec Google News Model which is a pre-trained corpus of over 3 billion words and growing.

Related Question