Find similarity of a sentence with 6 basic emotions using wordnet

688 Views Asked by At

i'm working on a project and a part of it needs to detect emotion of the text we work on.

For example,

He is happy to go home.

I'll be taking two words from the above sentence i.e happy and home.

I'll be having a table containing 6 basic emotions. ( Happy, Sad, fear,anger,disgust, suprise)

Each of these emotions will be having some synsets associated with them.

I need to find the similarity between these synsets and the word happy and then similarity between these synsets and the word home.

I tried to use WORDNET for this purpose but couldn't able to understand how wordnet works as i'm new to this.

1

There are 1 best solutions below

0
On

I think you want to find words in sentence that are similar to any of the words that represent any of the 6 basic given emotions. If I am correct I think you can use following solution.

First extract synset of each of the word sense representing 6 basic emotions. Now form the vectorized representation of each of these synset(collection of synonymous words). You can do this using word2Vec tool available at https://code.google.com/archive/p/word2vec/ . e.g.

Suppose "happy" has the word senses a1, a2, a3 as its synonymous words then 1. First train Word2Vec tool on any large English Corpus e.g. Bojar corpus 2. Then using trained word2Vec obtain word embeddings(vectorized representation) of each synonymous word a1, a2, a3. 3. Then vectorized representation of synset of "happy" would be average of vectorized representation of a1, a2, a3. 4. In this way you can have vectorized representation synset of each of the 6 basic emotion.

Now for given sentence find vectorized representation of each of the word in using trained word2vec generated vocabulary. Now you can use cosine similarity (https://en.wikipedia.org/wiki/Cosine_similarity) to find distance(similarity) of each of the word from synset of 6 basic emotions. In this way you can determine emotion(basic level) of the sentence.

Source of the technique : Research paper "Unsupervised Most Frequent Sense Detection using Word Embeddings" by Sudha et. al.(http://www.aclweb.org/anthology/N15-1132)