Sarcasm, according to Google is “ the use of irony to mock or convey contempt”. Interpreting it could be final frontier for AI.
Understanding Sarcastic line is a complex process. Depends on lots of variables — context, body language, tone modulation and so on. To be fair there is not proper/scientific way to decode sarcasm. To add to it, degree of closeness is (kinda) proportional to complexity of sarcasm.
In one of the scene Deadpool 2 movie, the lead actor was questioned who he is. Responding, he says, “I’m Batman”. The whole theater erupts in laughter. You can understand this if you’re aware of Batman and his punchlines.