r/MachineLearning • u/omarsar • Apr 30 '18
Research [R] Detecting Sarcasm with Deep Convolutional Neural Networks
https://medium.com/@ibelmopan/detecting-sarcasm-with-deep-convolutional-neural-networks-4a0657f79e8026
u/sssub Apr 30 '18
This is never going to work, sarcasm and irony require semantic understanding.
39
u/SanskariBoy Apr 30 '18
Yup. Deep CNN's are notoriously bad in being trained for semantic understanding. So many manually controlled features, grammar-based rules and Part of Speech tags need to be manually supplied that it's just not worth it. \s
5
u/omarsar Apr 30 '18
That's an interesting point! I wonder if there is any literature for this?
37
5
u/SanskariBoy May 01 '18
https://arxiv.org/abs/1607.00976
https://www.aaai.org/ocs/index.php/ICWSM/ICWSM15/paper/viewFile/10538/10445
There's neural network architecture they're calling CUE-CNN in the first paper. I'm not a 100% sure on how it works, but you could try reading it for more information.
I'm working on QA and Reading Comprehension models, and there have been multiple papers recently which make use of LSTM's, Attention Flow, Dynamic Memory NN's, etc. etc., which try to use NER and POS tags, but also leave it to the neural network itself to figure out the grammar.
To this end, I've found some other papers which use RNN's for semantic understanding, which I didn't bookmark before.
https://nlp.stanford.edu/pubs/tai-socher-manning-acl2015.pdf
That's one, but I'd read another before, with something related to Dependency Parsing, which I can't remember now.
2
u/DeepDreamNet Jun 21 '18
Showing up a little late to the party but curious what you think about coupling output from the Link Grammar tools into the network inputs.
→ More replies (3)6
u/neato5000 Apr 30 '18
Not perfectly perhaps, but you can do a reasonable job using a combination of lexical clues and contextual information like user history, etc. The poverty of this particular stimulus is not as weak as it seems at first glance. (Joshi (2016) has a good overview of sarcasm detection, and Kreuz 2007 shows how even humans benefit from lexical clues in identifying sarcasm in text). For instance there are certain constructions commonly used to convey sarcasm like the presence of excessively positive affect next to situations that are negative. E.g. " nothing makes me happier than a trip to the airport at 4am #lovinglife #killme". Or indeed phrases like "gee thanks for nothing.". Point is what I think is interesting about this problem is how well you can do, even without true semantic understanding. I don't think most people working on sarcasm detection aren't aware of how difficult it is, and how much it relies on a shared context between the speaker and the intended audience that is often absent from the text. Your comment is a bit like saying machine translation is a waste of time because we don't have Interlingua.
Joshi - https://arxiv.org/abs/1602.03426
Roger J. Kreuz , Gina M. Caucci, Lexical influences on the perception of sarcasm - https://dl.acm.org/citation.cfm?id=1611529
6
u/sssub Apr 30 '18
Thanks for this reply!
Especially your last sentence, I think the underlying question is even more abstract, 'What is intelligence? Do ML methods really understand anything?' I believe that thinking about artificial intelligence is actually thinking about what intelligence is.
We started with saying "If an AI can play chess it got to be intelligent!". But then we could argue traditional chess computers are not at all intelligent, it is just Mini-max + a smart heuristic. "But when we can play Go, this has to be true AI!" But you could argue AlphaGo is just a very smart way to compress the (relevant parts) of the Go search tree using a deep neural net + MCTS. Sarcasm and Irony are even stronger "strongholds" where I would believe true intelligence/understanding is required. But it is as you say, perhaps using statistics and ML you can eventually achieve behavior indistinguishable from humans. Intelligence seems to be elusive.
3
u/neato5000 Apr 30 '18
Likewise! Super thoughtful comment.
You're reminding me of Searle's Chinese room thought experiment https://en.m.wikipedia.org/wiki/Chinese_room . It can often seem like a system from the outside is indeed intelligent, but once we lift the lid and peer inside we would never accuse its individual constituent parts of understanding. There's an analogy to be made about individual neurons vs an entire brain perhaps.
I couldn't agree more with your second paragraph, but I'm not convinced that building ML systems really teaches us much about the nature of intelligence, though perhaps I missed your point.
2
u/HelperBot_ Apr 30 '18
Non-Mobile link: https://en.wikipedia.org/wiki/Chinese_room
HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 176880
2
May 01 '18
You should just remove the word "seem". The Chinese room is one of those so misunderstood thought experiments, because it shows nothing more than the immediately obvious fact that the components of the system don't have to be intelligent. Noone seems to complain that the atoms in our brain aren't conscious and living, yet get hung up on the equivalent Chinese room.
2
Apr 30 '18
Seems to me like this part is the most important:
Leverage user profiling, emotion and sentiment features for sarcasm detection
I would think that more than anything else, sarcasm requires being able to detect subtle emotive cues. Thus the trend of people on reddit using /s to designate sarcasm. Cause there are no emotive cues here.
Hell, I get fooled sometimes in person by super dry humor and that's along with the fact that I tend to use a lot of super dry humor of my own. And I would guess the main reason is because dry humor lacks any kind of emotive cues. The deadpan of it makes it similar to trying to interpret text on the internet.
1
u/phobrain May 01 '18
Hilarious! :-)
Analyzing responses, and knowing about the responders, would be the best clue for me if I had no vision, I think.
1
u/ATownStomp Apr 30 '18
This is a mostly irrelevant reply but I'd like to state for everyone reading that using the "/s" sarcasm tag defeats the purpose of using sarcasm. Don't use the sarcasm tag. It's one step removed from using "/h" to designate something humorous.
5
Apr 30 '18
Respectfully, I disagree. It may seem odd at first, but it allows people to communicate fluently through text in ways that they'd otherwise struggle with.
Not all sarcasm is meant to be the subtle, insulting kind, where the target is only supposed to get it if they are "smart enough" to pick up the subtext.
Some sarcasm is more like friendly banter between two people, where understanding that sarcasm was used is vitally important to the conversation and it just doesn't work as banter otherwise.
3
u/ATownStomp Apr 30 '18
I want you to ask yourself why sarcasm is used as friendly banter between people, and what it means to understand someone else's sarcasm. How does that allow people to associate or conflict in a way that being explicit doesn't?
Communicating "fluently" involves adapting to the limitations of your medium in order to retain not just the immediate meaning but the implications and the effect of your message. Far from facilitating effective communication the sarcasm tag permits a lazy disregard for the medium. It is a self-defeating safety valve for people who are unable or unwilling to commit to the device for fear of being misunderstood.
→ More replies (1)2
u/Brudaks May 01 '18
It's even more difficult - perfect semantic understanding of a sentence or comment by itself isn't sufficient to detect sarcasm, you need to understand or know the real world context in which the phrase was made.
I.e. to check whether "Doing [.....] sounds like a really good idea" or "I was so overjoyed when the staff did [....]" is a serious comment or sarcasm, it's not sufficient to literally understand the exact semantics of what the comment says and what is the thing being described, but it also needs a value judgement, it needs to decide whether the speaker would realistically like that thing or not. And it's not even sufficient do decide whether that thing is "good or bad" in some objective sense - there are all kinds of suggestions that would be considered reasonable by e.g. one political party and sarcastical if said by their opponents, so you need to know who is saying that and have a decent "theory of mind" about their beliefs.
1
47
63
19
u/gagejustins Apr 30 '18
Great, another paper about CNNs. That's exactly what we need. /s
5
u/galexj9 May 01 '18
are you being sarcastic about how bitter this sounds or sarcastic that we don't need any more CNN papers?
3
6
u/sdmskdlsadaslkd Apr 30 '18
Serious question: why does this have so many upvotes? This has been done numerous times.
3
u/Pieranha May 01 '18
I'm also quite surprised.. it's a well-written Medium post, but the paper is about a year old and it applies a fairly standard CNN architecture. It's not even state of the art any more (DeepMoji).
2
u/phobrain May 01 '18 edited May 02 '18
DeepMoji only takes short sentences, and you must be emoji-fluent to understand its response, so I'm waiting on tenterhooks for something that can truly address my needs. My boss wants me to blow the rest of the quarter's budget on this so that we don't look bad for underspending, so it's got to be done right.
Edit: I meant to say 'SPEND the rest'. I would never say 'blow'.
1
9
2
u/phobrain Apr 30 '18 edited May 01 '18
I have never seen an app that begged more to be put online! On to reverse sarcasm!
Seriously, I think I may have raised sarcasm to transcendental levels, in that I layer criss-cross sarcasms word-by-word as densely as possible, sometimes even to the depth of a milliliter or two.
Edit: 'sarkoan' - you heard it here first! Edit: ok, 'snarkoan'. As in the Travelling Snarkoans, prospective band members can apply here. And never let me hear you say, 'I had a snarkgasm over all that sarcasm.'
1
May 01 '18
I have never seen an app that begged more to be put online!
1
u/phobrain May 01 '18 edited May 03 '18
See my response in the dedicated thread above.
Edit: found myself without a fig leaf in the wild:
Giuliani: Trump repaid Cohen $130K for payment to porn star THIS MAKES ME FEEL BETTER - for a minute there, it seemed like donald had had unpaid sex with someone, and he is far too much of a gentleman not to pay the lady, unless he can get out of it somehow as is his right.
2
u/YourHomicidalApe May 01 '18
I'm relatively new to ML: Why is the author getting different results when he trains on 1 dataset and tests on a 2nd one? Shouldn't having a training and testing subset solve the overfitting? Or is there still a more 'hidden' overfitting behind it.
3
May 01 '18
Because the datasets are sampled from different populations. From the paper:
Dataset 1 (Balanced Dataset) This dataset was created by (Ptacek et al., 2014). The tweets were downloaded from Twitter using #sarcasm as a marker for sarcastic tweets. It is a monolingual English dataset which consists of a balanced distribution of 50,000 sarcastic tweets and 50,000 non-sarcastic tweets.
Dataset 2 (Imbalanced Dataset) Since sarcastic tweets are less frequently used (Ptacek et al., 2014), we also need to investigate the robustness of the selected features and the model trained on these features on an imbalanced dataset. To this end, we used another English dataset from (Ptacek et al., 2014). It consists of 25,000 sarcastic tweets and 75,000 non-sarcastic tweets.
Dataset 3 (Test Dataset) We have obtained this dataset from The Sarcasm Detector. It contains 120,000 tweets, out of which 20,000 are sarcastic and 100,000 are non-sarcastic. We randomly sampled 10,000 sarcastic and 20,000 non-sarcastic tweets from the dataset. Visualization of both the original and subset data show similar characteristics
2
u/Mulien May 01 '18
The key contribution here seems like that they're leveraging information from several different sources which is always pretty cool. It would be interesting to see this reposed as a proper multi-task learning problem, rather than just with pretraining. Also with an RNN architecture since they're almost universally better on NLP tasks compared to CNNs.
2
u/Pieranha May 01 '18
The state of the art in sarcasm detection, DeepMoji, uses an RNN architecture.
4
1
u/phobrain May 01 '18
How about a sarcasm generator? Feed it this article..
https://www.reddit.com/r/MachineLearning/comments/8g37o1/d_ai_can_help_cybersecurityif_it_can_fight/
1
May 01 '18
People aren't even good at detecting sarcasm... And how is it supposed to deal with Poe's law?
1
1
1
1
May 01 '18
According to the law of reversibility it would be really easy to build an sarcastic bot out of this.
But face it, ANNs suck at humour at this Moment.
1
u/Pieranha May 01 '18
Sarcasm detection is interesting and it's a well-written Medium post, but the amount of upvotes this reddit thread is getting is astonishing to me. The paper is about a year old, it applies a fairly standard CNN architecture and it's no longer the state of the art.
What am I missing here?
1
u/wuliheron May 01 '18
Cool idea, let me guess, Google? They're working on developing an AI that will allow people to literally dial up or down the flames online. I love Babylonian slapstick sometimes and, with Babylonians, you take your laughs where you can get them. Sad to say, my own father has the gift of sparkling laughter, the infectious kind nobody can resist. We sometimes yell at him to stop laughing and, of course, that makes him laugh all the harder. Taoists say, the naive humor of the toddler is the hardest to master because, of course, You are the toddler dummy!
1
u/I-am-a-llama-lord Apr 30 '18
Detecting sarcasm... as a socially awkward person, it's scary that robots are gonna be better with people than I am.
1
0
0
-1
u/arsch_loch Apr 30 '18
Can somebody please tell Data from Star Trek about this?
2
u/visarga May 01 '18
Data needed RL to develop emotion, not a piece of skin. The writers missed that opportunity. Emotion is the prediction of future rewards.
2
0
Apr 30 '18
[deleted]
28
u/shaggorama Apr 30 '18
Honestly, that would be a great way to build a training dataset, but I imagine a lot of that kind of example would not be identifiable as sarcasm without the context of ther parent comment/ submission, since people generally only use "/s" when they're concerned others won't be able to detect their sarcasm.
13
u/Silanah May 01 '18
There was a paper on ArXiV last year. I haven't read it, but they seem to use the "/s" tags to build a dataset for sarcasm. Here it is - https://arxiv.org/abs/1704.05579
10
7
Apr 30 '18
[removed] — view removed comment
3
u/phobrain May 01 '18 edited May 01 '18
It ranks a sentence from -100..100.
Examples rated and sorted by increasing sarcasmicity:
Here's the first sentence of the link below that I suggest could help generate sarcasm:
WALKING THE ENORMOUS exhibition halls at the recent RSA security conference in San Francisco, you could have easily gotten the impression that digital defense was a solved problem. Amidst branded t-shirts and water bottles, each booth hawked software and hardware that promised impenetrable defenses and peace of mind. The breakthrough powering these new panaceas? Artificial intelligence that, the sales pitch invariably goes, can instantly spot any malware on a network, guide incident response, and detect intrusions before they start.
-86
Seriously, I think I may have raised sarcasm to transcendental levels, in that I layer criss-cross sarcasms word-by-word as densely as possible, sometimes even to the depth of a milliliter or two.
-41
Lost in the venal void, our dreams deflate by easy stages through green atmosphere; imagination's bright balloon is late, like the blue whale, in coming up for air. [Mervyn Peake]
-19 [-24 with 'stages spelled 'sages']
Hi Boris!
-19
Inventors have long dreamed of creating machines that think. [Deep Learning Book sentence 1]
5
When programmable computers were first conceived, people wondered whether such machines might become intelligent, over a hundred years before one was built. [Deep Learning Book para 2 sentence 1]
17
Rather than ka-ching-per-satori, or an advertising model, I propose to make Phobrain a public utility, using blockchain for sharding to guarantee privacy, and financed by provision of a universal identity service to guarantee transactions for individuals, businesses and governments.
21
Edit: note accuracy is flipped on my two quotes: 'layered sarcasm..milliliter' ranks serious, serious proposal 'utility' is marked the most sarcastic of all.
1
282
u/harponen Apr 30 '18
Ooh this has to be one of the most important deep learning applications of the decade!