3
$\begingroup$

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?
$\endgroup$
  • $\begingroup$ Please clarify your question. Do you have just two sentences or do you have a bunch of pairs of sentences? You can't apply a neural network to one pair of sentences. If you have many pairs of sentences, will you be labeling them to train a neural network or are you expecting some unsupervised solution? Provide some examples of your sentences. $\endgroup$ – Brian O'Donnell Feb 21 '17 at 19:13
  • $\begingroup$ The labelled pair is just one instance of the training set. $\endgroup$ – daria Jun 23 '17 at 14:03
  • $\begingroup$ @BrianO'Donnell: say I am using a lexical database like WordNet, which gives me synonyms, antonyms and lemmas based on various contexts for a given word. Are there any unsupervised solutions possible to determine if any two given sentences or phrases are similar or not. For example, phrases, 'car factory' and 'automobile plant' should be labelled similarly, but 'automobile factory' and 'textile mill' should be labelled differently. $\endgroup$ – m1cro1ce Mar 14 '18 at 13:10
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ any idea what is the purpose of head and tail arguments in github.com/JennaBellassai/phrase-similarity/blob/master/… of the libraries scoring function? $\endgroup$ – m1cro1ce Mar 15 '18 at 8:12
  • $\begingroup$ I have no idea. Her only note on this is: "Note that the scoring measure in similarity_score.py only looks at the first 100 words of the first phrase and the first 10 words of the second phrase by default." $\endgroup$ – Brian O'Donnell Mar 16 '18 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.