Sumeet More
2 min readSep 24, 2019

Detecting sarcasm using deep learning.

I will divide this into 2 part series.

Part-1 : What is final Output. Code and output explanation.

Part-2 : What is deep learning. What is neural network, recurrent neural network, LSTM(without using maths, I will try :P)and how we solved the problem of detecting sarcasm.

This is part 1 of the post.

I don’t know whether you have hard time to differentiate between normal statement and sarcastic statement, but I do.

And today deep learning is going to help us with that. I have used Keras library to code recurrent neural network(RNN). I have used movie data to make RNN understand how to detect sarcasm through sarcastic movie reviews.(Ideal datasets is Chandler’s lines from friends :P). I don’t remember where I read this but it says “One of the quality of good AI engineer is that he/she can see pattern in datasets even before selecting model.”(Damn, I guess we all got a new goal now).

As you can see, we trained network over 4 lacs parameters and this is distinguishing factor between machine learning and deep learning.

We predicted movie review “I love this movie so much that I want my money back” and deep learning gave us score 0.13 where closer to zero means, statement involves sarcasm and vice versa.

Now we know what we are building, I hope part 2 will be interesting for you.

Happy Learning ☺

Sumeet More
Sumeet More

Written by Sumeet More

Software Engineer 2 at Microsoft | Backend Engineer and Architect| Blockchain & ML enthusiast | C#,.NET Core, Rust, Javascript and Go

No responses yet